Not sure how to explain this, but here it goes.
I have a remote event in replicated storage that, when fired, it gets the player, amount of money to handle, whether to add or subtract said amount, and a code. so when fired from a local script it looks like this (I changed the password):
game.ReplicatedStorage.RemoteEvents.ManageMoney:FireServer(cost,"add","password123")
then, on a script inside ServerScriptService, it handles it like this:
function manage_money(player,amount,operation,pass) local name = player.Name local plr = game.Players:FindFirstChild(name) if pass == "password123" then if operation == "add" then for i = 1,amount/5 do wait(0.01) plr.Settings.Money.Value = plr.Settings.Money.Value+5 game.SoundService.coins_pay:Play() end elseif operation == "remove" then for i = 1,amount/5 do wait(0.01) plr.Settings.Money.Value = plr.Settings.Money.Value-5 end end elseif pass ~= "password123" then if plr:IsA("Player") then plr.Settings.HasExploited.Value = plr.Settings.HasExploited.Value+1 plr:Kick("You have been kicked for exploiting.") end end end
it all works well for me however confusing it is to any other people looking at my code, but then I encountered a problem: I wanted to give players money for touching a pad at the end of a practice obby, but I cannot do this without a localscript!
please help me with this and tell me if I need to clarify anything :)