Amir_William Posted February 13, 2022 Posted February 13, 2022 i wanna make cmd and when player used command , source give some money to player but if player want to used command again = false or return
Cronoss Posted February 14, 2022 Posted February 14, 2022 function giveMoney(cmd) if (moneyChances == nil) then ------if moneyChances == nil | moneyChances doesn't appear before in the function, the value it's nil givePlayerMoney(source, 50000) ------50.000 the amount of money the player get with the command. (You can edit this number) moneyChances = 1 -------moneyChances = 1, so the first variable now it's NOT nil, that should block the option of giving the money to the player else outputChatBox("You already used this command.", source, 255, 0, 0) --------if moneyChances == 1 then this text shows up end end addCommandHandler("money", giveMoney) (server-side) PD: Not tested, but this could give you an idea on how to make it, I hope it help you note: I'm new trying to help in this section, if I'm wrong or I missed something please tell me and I'll learn about my mistake
Hydra Posted February 14, 2022 Posted February 14, 2022 (edited) 7 hours ago, Cronoss said: function giveMoney(cmd) if (moneyChances == nil) then ------if moneyChances == nil | moneyChances doesn't appear before in the function, the value it's nil givePlayerMoney(source, 50000) ------50.000 the amount of money the player get with the command. (You can edit this number) moneyChances = 1 -------moneyChances = 1, so the first variable now it's NOT nil, that should block the option of giving the money to the player else outputChatBox("You already used this command.", source, 255, 0, 0) --------if moneyChances == 1 then this text shows up end end addCommandHandler("money", giveMoney) (server-side) PD: Not tested, but this could give you an idea on how to make it, I hope it help you note: I'm new trying to help in this section, if I'm wrong or I missed something please tell me and I'll learn about my mistake Or like this: local used = false function givecash(command, thePlayer) if used == false then givePlayerMoney(thePlayer, 5000) used = true elseif used == true then outputChatBox("Already used this command", thePlayer, 255, 0, 0, true) end end addCommandHandler("cash", givecash) Edited February 14, 2022 by Hydra Social Media: Discord: Gabriel45#6859 Instagram: https://www.instagram.com/_gabriel_455/ YouTube: Hydra45 (https://www.youtube.com/c/Hydra45/)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now