![]() |
Really simple question :)
Ok, i'm trying to learn how to script and i'm doing something that when it happens it won't happen again.
for example. NPC Code: It thought it might be something like this but it doesnt work NPC Code: And whats the command for if all enemies are dead....? |
Re: Really simple question :)
Even though the second part of the money script finds that the event is false, it is still re-running the first event each time the player speaks.
I think you are looking for something like this: NPC Code:if (playerchats&&strequals(#c,Hello)) *note: There is most likely a more efficient way to do this* I hope this helps. |
Now don't go forgetting your semi-colons, they have a lot to do with scripting.
EDIT: No need to set a flag. |
ok that doesnt really work.
If you type "hello" once you get nothing and if you type hello1 or anything else after your money just goess up =( |
A variable will help the script to work once. E.g:
NPC Code: Done,you did it once and next time you won't be able to get more 10 gralats. Why did i put 'playerrupees' with underline? Because seems (is) better to use than players[index].rupees since it's for you. Quote:
|
Ah, hm.
I should probably stop trying to help people in this section. ^_^;; Thanks osrs, that helped me out too. |
Quote:
|
geez, every one of you suck at formatting x_X
|
Quote:
Quote:
But setting a flag work too. |
Quote:
Also, you didn't specify an index for player[index].rupees. I also think that is read only. |
funny how everyone is using the code brackets, yet half of them don't even bother to actually use spaces (the whole point of using code brackets)
|
This is all you need.
NPC Code: Simple as. |
Quote:
Quote:
|
In any case, I would think it's better to use playerrupees.
|
Quote:
|
Quote:
NPC Code: couldn't remember what they're called exactly ohyeah tags... d'oh |
Ah, you're talking about indenting within code tags. Fair enough, I misinterpreted :)
|
It always seems like storing a string that only checks if a player has touched an NPC, would waste space and make a disarray of the player's stored strings etc.
|
Quote:
|
Quote:
NPC Code: instead of NPC Code: |
Erm, just click the "style" button?
|
Quote:
Quote:
If the server went down wouldn't all npc's not work? |
Quote:
Quote:
|
Sigh. If you ever try to make anything remotely complicated, you'll understand the value of proper indenting.
|
Quote:
|
Quote:
|
Quote:
Explains why farming NPCs&stuff suddenly are gone sometimes. |
Quote:
I thought I remembered a time on another server when that happened. All of my NPCWs disappeared, as expected, but I don't remember level NPCs dying with the server. It's probably my bad memory again. :P |
| All times are GMT +2. The time now is 07:13 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.