![]() |
passing vars -> putnpc
I'm trying to pass a varible (account name) through putnpc so that the NPC can have a "master" when it's created. I know a few ghetto ways of doing, like putting a flag in the "master"'s account and having the NPC scan through players in the level to detect that flag, and after using the putnpc doing a triggeraction on the NPC setting the "master"'s account there.
Is there a more effecient way of doing this? |
If I understand you correctly, you can do something like...
NPC Code: Then in a class npc... NPC Code: It all depends on how you want to do it. |
That won't work. When the putnpc is placed it has no communication between itself and your account...it's like a blank script...so you can't pass the account.
That's the problem I ran into. |
isn't that what playero.account is for?
Quote:
|
with(putnpc2(x, y, "join class")){ stuffs in here };
edit to the post below: try it and find out :], it works wonders. |
Quote:
Gilt, That wouldn't work. It's not like playertouchsme...it's a fresh NPC with and it's had no communication with another NPC or player. [Edit] Actually I don't even think that would work...in order to use with() on an NPC it has to be a) a database NPC or b) you have to have the index of the NPC in combination with npcs[] I do believe...[/Edit] |
Oh, you silly geese.
PHP Code:
|
Oh, and with() can get ANY object.
Any object at all. GUI, NPCs, players, images, ganis, ect. |
Quote:
But if you're using with() don't you need to specify what you're searching for? Like with (players[])? Thanks for the answer. |
Quote:
|
Quote:
You do normally need to do with (players[]), but you could also do something like: PHP Code:
|
Quote:
PHP Code:
PHP Code:
PHP Code:
|
| All times are GMT +2. The time now is 11:01 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.