Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-03-2010, 08:21 PM
N01ze N01ze is offline
Level Designer
N01ze's Avatar
Join Date: Aug 2010
Posts: 46
N01ze is on a distinguished road
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
Reply With Quote
  #2  
Old 09-03-2010, 08:23 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
PHP Code:
player.attr[1] = "hatimg.png"
edit:
PHP Code:
//#CLIENTSIDE
function onCreated(){
  
player.attr[1] = "hatimg.png";

Reply With Quote
  #3  
Old 09-03-2010, 08:27 PM
N01ze N01ze is offline
Level Designer
N01ze's Avatar
Join Date: Aug 2010
Posts: 46
N01ze is on a distinguished road
Thanks
Reply With Quote
  #4  
Old 09-03-2010, 11:31 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Cubical View Post
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.'
__________________
Reply With Quote
  #5  
Old 09-03-2010, 11:42 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Oh, I misread and thought he was talking about setting a players attribute.
Reply With Quote
  #6  
Old 09-04-2010, 03:27 AM
N01ze N01ze is offline
Level Designer
N01ze's Avatar
Join Date: Aug 2010
Posts: 46
N01ze is on a distinguished road
Ooh ok thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:42 PM.


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