![]() |
Train Script Problem
Basically im making a train that moves on tracks by its self, but iv ran into a problem.
the tracks are npcs that set images to whatever track piece it is. is there any way to check if a npc is touching a certain npc and set its this.mode = whatever depending on whats in the npc its touching? thanks in advanced. im sure theres a way to do it :rolleyes: |
You can find all the NPCs at one point by doing something like
PHP Code:
|
with the for findAreaNPCs(x, y, 0.1, 0.1)
what are the 0.1's? |
Quote:
Quote:
|
is there any way to change another npcs variable by some command like findnpc("whatever").this.mode = ?
if i made it join to a class how would i change the class variables via a script? |
Quote:
PHP Code:
What do you mean by class variables? That doesn't make any sense, classes are joined to an object. They don't have separate sets of variables. |
whoever repped me for "being a disgrace to the 'scripter' title"
these forums are a place to learn, i am relativly new to scripting. so please in future dont judge people over their scripting ability. if this is your outlook on life i really dont think these forums are the place for you. @cbk1994 i mean class variables as in if a class has this.whatever = whatever; |
Quote:
|
ahh thats a batter idea.
can i put PHP Code:
im at work so i cant test it. |
What do you mean by "go to the class"? You seem to have a misunderstanding of how classes work. It doesn't create another object or stop execution of the current one. Imagine the class' script being copied and pasted into the NPC you join it to. onCreated in classes will be triggered if you join the class to something.
|
thanks i tested it at home, i thought if i joined it to a class seeming my class had a timeout it would go execute my class and stay on the class because its looping.
|
All times are GMT +2. The time now is 07:59 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.