![]() |
Script Help
This is my first post so if the code didnt show up right thats why lol.
The script editor is givin me the Expected Format Error with this code and I cant see why. NPC Code: I also tried it the way it shows in npcscripting.doc NPC Code: That is the way the editor says it should be done but it still wont except it. Thanks for your help |
Also for some reason my beer will not display until I exit and re enter the room. It should work here is the bartender part of the code.
NPC Code: Now here is the actual Beer npc code NPC Code: If there is somthing wrong please tell me so i can figure out what i did and not do it again lol |
Incorrect:
NPC Code: Correct: NPC Code: Spot the difference? Also, use if (playerchats && strequals(#c,text)) rarther than if (playersays()) There is a much more efficient method of doing that beer thing. Try using else, and you don't really need to set flags. |
ok ill have to try that, but the space in the for code makes no difference, i just tried it. oops i see i have a { instead of (. Also I tried your suggestion for the playersays, it doesnt change the fact that the stupid beer still wont appear until i exit and come back, but ill use that instead anyway, since its more effecient.
|
well after countless tries i realised that its easier to make a text file with the script and call an npc, it saves many lines of code and reduces errors greatly.
Also if anyone would have an idea how to set a players sword power to 2 or more for 20 seconds and have it revert back to what it was lemme know. |
NPC Code: NPC Code: Thats one way, if i was you i'd rather use putnpc. NPC Code: |
.. I do this alot, thats why my post gets deleted but thats a full script =o.
Quote:
|
putnpc2-ing would be superior.
Also, I'd suggest nesting the money check inside the if playerchats and asks for beer, then you could use an 'else' instead of rechecking if the playerchats and doesn't have the money. Tyrial did this in his example, but did not explain what or why he did. The same goes for your 'playerrupees -5' to the correct way to do that: 'playerrupees -=5'. And Tyrial...for goodness' sake, please use proper formatting, especially when trying to help someone new. And, explain what you're doing so they can learn. Just posting a way to do it (be it the correct way or not) without an explanation doesn't teach the person anything. |
Quote:
|
Quote:
This would be better..=) NPC Code: |
Quote:
The old "Give a man a fish / teach a man to fish" saying comes to mind. The best way to help someone is to is not just to do the work for them, but to explain what you changed and why you changed it, so they can understand what happened, and learn from it. |
Its cool guys, i appreciate all your help in all the forms, here is what I did to correct it.
NPC Code: which works fine, I just need to figure out how to change things like the players sword power for say 60 seconds after drinkin the beer. Hopefully ill think of somthing. |
You forgot events, setting a flag does not trigger an event to run the script, you probably should either do the putnpc thing that was suggested earlier, or call the npc for an update via triggeraction or callnpc.
|
Quote:
|
Quote:
|
*shouts for joy*
|
Quote:
|
Quote:
Quote:
Quote:
|
| All times are GMT +2. The time now is 11:21 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.