![]() |
Help With A Buybable Hat Script Please?
basically i have a hat setup as a weapon so u equip it and press d
i want to sell it in a level with a npc. here is the npc script but it doesnt work :/ could someone please tell me what im doing wrong :3? thanks gunderak //#CLIENTSIDE function onCreated() { dontblock; } function onPlayerChats() { if (player.chat =="/Buy Gund Dino Hat"){ if(playerrupees>=1000) addweapon("Hats/Dino Hat"); playerrupees-=1000; } } |
Quote:
|
could you show me an example of it as a trigger so i can study it and figure out exactly how itd work?
|
Quote:
Otherwise the most basic thing to do would be: PHP Code:
|
ah so u define the commands on server side bit and clientside uses them
thanks so much man now i understand it so much better =D i also plan to make a /warn for a warning system... so far no luck rofl |
Quote:
|
iv also added
} else { player.chat = "You Have Already Purchased This Weapon!"; } thanks again man you really have helped me =D |
ooh lol i thought triggeraction was triggering an action defined on creation rofl
|
Quote:
PHP Code:
PHP Code:
|
If it's in a level NPC there's no reason to use a trigger. onPlayerChats (and onPlayerTouchsMe) is called both serverside and clientside in NPCs.
|
its in a weapon, also how would i make it if player.rupees <=1000; player.chat "u dont ave enough money";
iv tried to add it into it but im having no luck :/ |
Quote:
http://public.zodiacdev.com/index.ph...#Part_3:_Logic |
i used an if statement but i am unsure where to put it
:/ |
Quote:
Guide Link: http://public.zodiacdev.com/index.php?title=Fowlplay4 (I'm pretty sure you've been linked to it at least 3 times now...) Programming/scripting in general usually isn't something you can pick up with ease and it will take time. But here's a visual for you: http://img38.imageshack.us/img38/7408/thelogic.png If you understand that image, and you understand what certain pieces of code actually does you should be able to figure out where the logic needs to be placed. |
so somthing like the first bit then
if player.rupees <=1000; triggerserver blah blah blah; } else { player.chat = "I Dont Have Enough Money!"; return; would that do it? thanks btw for helping. iv also made a wicked gui =D function onActionServerSide() { if (params[0] == "jail") { findplayerbycommunityname(params[1]).setlevel2("jail.nw", 31.5, 28.5); } if (params[0] == "unjail") { findplayerbycommunityname(params[1]).setlevel2("ge_f2.nw", 0, 24); } if (params[0] == "warn") { findplayerbycommunityname(params[1]).setlevel2("warning_room.nw", 37.5, 16.5); } } //Scripted By Gunderak //#CLIENTSIDE function onKeyPressed(code, key, scancode) { if (key == "3") { new GuiWindowCtrl("MyGUI_Window1") { profile = GuiBlueWindowProfile; clientrelative = true; clientextent = "161,87"; canmaximize = false; canminimize = false; canmove = true; canresize = true; closequery = false; destroyonhide = true; text = "Tools"; y = 96; new GuiButtonCtrl("MyGUI_Button1") { profile = GuiBlueButtonProfile; text = "Jail"; width = 80; } new GuiButtonCtrl("MyGUI_Button2") { profile = GuiBlueButtonProfile; text = "Unjail"; width = 80; y = 29; } new GuiButtonCtrl("MyGUI_Button3") { profile = GuiBlueButtonProfile; text = "Warn"; width = 80; y = 58; } new GuiTextEditCtrl("MyGUI_TextEdit1") { profile = GuiBlueTextEditProfile; height = 20; width = 80; x = 80; y = 5; } new GuiTextEditCtrl("MyGUI_TextEdit2") { profile = GuiBlueTextEditProfile; height = 20; width = 80; x = 80; y = 34; } new GuiTextEditCtrl("MyGUI_TextEdit3") { profile = GuiBlueTextEditProfile; height = 20; width = 80; x = 80; y = 64; } } } } function MyGUI_Button1.onAction() { triggerserver("gui",this.name,"jail",MyGUI_TextEdi t1.text); } function MyGUI_Button2.onAction() { triggerserver("gui",this.name,"unjail",MyGUI_TextE dit2.text); } function MyGUI_Button3.onAction() { triggerserver("gui",this.name,"warn",MyGUI_TextEdi t3.text); } now i just need to make it open that when u double click a player and automaticly fill the text box's with the players comm name =D you wouldnt happen to know how to do that would you :3? thanks again -Gunderak |
Quote:
PHP Code:
If you'd read the guide linked to you, you'd see that the proper syntax for an if-else statement is: PHP Code:
player.rupees <= 1000 would be true if they had less than or equal to 1000, so change it to player.rupees >= 1000 and plug that in: PHP Code:
PHP Code:
|
This is a solution, but if you had lots of hats and you made a weapon for EVERY hat, then your weapons list would start to look like testbeds. Surely there is another way to go about doing this?
|
Quote:
Example (using clientr.hats you need to add all the hats you want to your self): PHP Code:
|
| All times are GMT +2. The time now is 10:57 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.