![]() |
I need some help!
Okay I need some help with an NPC.
I am trying to make it where, when you walk onto it it lights up but when you walk off the lights turn off. Here was my attempt! // NPC made by Ramsey if (created) { setimg whatever.gif; dontblock; drawunderplayer; } //#CLIENTSIDE if (playertouchsme) { setcoloreffect 1,1,1,0.99; drawaslight; sleep 1; } |
And also it's lighting the image up wieard so I I am not sure what is wrong. Maybe I would just put lights under it and have them triger on when you touch them and triger off when you stop touching them. But I still dont know how to do that.
|
*bump*
|
*BUMP*!!!
*BUMO*!! |
since it seems psichill has decided to post with nothing important, i'll fix it...:-/
NPC Code: |
that was not cool spamming my thread :rolleyes: :mad: :grrr:
|
Quote:
|
no really it wasn't spam i just haven't finished the script yet...i'll post it tonite...
|
Re: I need some help!
Quote:
You could use a timeout and do something like if (playerx>x&&playery>y etc.) |
Re: Re: I need some help!
Quote:
if (created) { setimg image.gif; dontblock; drawaslight; timeout=0.05;} if (timeout) { if (playertouchsme) {show; setcoloreffect 1,1,0,.99;} else {hide;} timeout=0.05;} I dunno, im not too good at this scripting stuff... |
Re: Re: Re: I need some help!
Quote:
I mean, have a thing to check to see if the player is within a box. if (timeout&&playerx>x&&playerx<x+4&&playery>y&&playe ry<y+4) The above would check in a 4 tile square... might be a bit laggy though. :( |
playertouchsme does work when it is non-blocking silly.
if might be cool if there was if (playertouchsme) was true the entire time the player was touching the npc and playernottouchingme was true when he stops touching it... but since we don't have that... blah who knows. I'd just check for the x y area in a timeout loop. |
| All times are GMT +2. The time now is 12:10 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.