![]() |
Flag problem thing
NPC Code: The bolded part is a flag. The only problem is that even when the flag is set, it won't give the message "You already have a mine!" |
You've got the playergralats thing again.
|
Quote:
|
Go in at each point and check the variables:
1. Do you have 5 gralats? 2. Is mine.onea == 0 ? 3. Did you type 'rent mine 1' correctly? These may seem like quite stupid questions, but usually that's how I would debug something :P |
Yes
Yes Yes My guess is that for some reason it doesn't check for the flag x_x Oh well... *Waits for a 1337 scripter like Kai or Archaon to show up* |
if (playerchats&&strequals(#c,rent mine 1)){
if (playerrupees=>5 && mine.onea=0 && ownsmine){ say2 You already have a mine!; } } make sure mine.onea=0 and that you have more then 5 rupees and ownsmine is set.. |
Quote:
|
lets see the first if that comes before that that actually rents out the mine if it isnt ownsmine:D
|
Thanks, still have the flag problem though x_x
|
Quote:
|
Quote:
use client.mineowned=1; and if (client.mineowned==1) { } |
You mean like this?
NPC Code: Because that still doesn't work x_x |
Quote:
|
NPC Code: Tada, this works.. just need to put "else" in front of the if and remove the set ownsmine; line. |
Quote:
As for the debugger, I used Koni's script, put it into the debugger, put the breaks beside them and then here's what happened. Well, first it pauses the game, then in the dubugger it had the first line blue, I hit next, and the 2nd line turned blue, then I hit next again and the 5th line turned blue. |
Quote:
|
I have a few things to say, one to googi:
The best way to get better with scripting is to start with smaller things, like for example, do bars and menus. Also I would suggest trying to have some more advanced scripters give you their showoffs, perhaps search the Scripting Forum for some showoffs. Another things to experiment with would be things like string manipulation, try playing with things like strlen, startswith, and stuff like that, my favorite is #e(). The next thing to Kai: Debugger owns... I cannot tell you how many times debugger has saved me from countless hours of playing "find the error". Also wouldn't it be cool if there were a online debugger...woah...*goes to Future Improvements Forum even tho none of the improvements actually ever happen*. |
Quote:
|
Quote:
|
Quote:
client.ownsmine=1; and if (client.ownsmine==1) { } then youre wrong :/ |
Quote:
|
Quote:
NPC Code: |
Quote:
|
Well, now the script is this...
NPC Code: And of course, it doesn't work On the debugger, all the red lines turn blue (in sequence with the hitting of the run button of course) |
Quote:
|
Quote:
*checks script* It's there on the script, just not on the post x_x EDIT: Just noticed this, but when I try to rent the SAME mine TWICE it comes up with the message "you already own a mine" |
No, I want it to stop you from renting more then one mine.
|
Yeah, it doesn't do that.
|
Quote:
The player says "rent mine 1" They get the mine THe player says "rent mine 1" again (while they still own the mine) The message comes up "You already have a mine!" But if they say "rent mine 1" They get the mine Then they say "rent mine 2" They get mine 2 aswell. |
Done
|
Quote:
- Client.blah = 100 - setstring client.blah,Muahah; So the first one won't stay with the player, and the second one will... Good...now all i have to do is go through 100000 lines of code and fix them :grrr: :grrr: :grrr: :rolleyes: |
| All times are GMT +2. The time now is 12:50 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.