Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   A nooby scripting question (https://forums.graalonline.com/forums/showthread.php?t=134260418)

N01ze 09-03-2010 08:21 PM

A nooby scripting question
 
I know these may sound really stupid, but I just started scripting and I was wondering how you set a hat for an NPC :O

If you could help, that would be great.

Thanks,

~N01ze

Cubical 09-03-2010 08:23 PM

PHP Code:

player.attr[1] = "hatimg.png"

edit:
PHP Code:

//#CLIENTSIDE
function onCreated(){
  
player.attr[1] = "hatimg.png";



N01ze 09-03-2010 08:27 PM

Thanks :)

cbk1994 09-03-2010 11:31 PM

Quote:

Originally Posted by Cubical (Post 1598527)
PHP Code:

player.attr[1] = "hatimg.png"

edit:
PHP Code:

//#CLIENTSIDE
function onCreated(){
  
player.attr[1] = "hatimg.png";



Should be

PHP Code:

function onCreated() {
  
this.attr[1] = "hatimg.png";


Note 'this.' and not 'player.'

Cubical 09-03-2010 11:42 PM

Oh, I misread and thought he was talking about setting a players attribute.

N01ze 09-04-2010 03:27 AM

Ooh ok thanks :D


All times are GMT +2. The time now is 05:46 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.