local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() if player.leaderstats.Coins.Value >= 100 then script.Parent.Roll:FireServer() player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 100 end end)
so i made a local script in a gui that takes coins if you have enough (dont mind the remote event) when i get money again it gives 10 coins (the normal amount) plus the amount that the local script took
-- Put this in the LocalScript local Players = game:GetService("Players") local player = Players.LocalPlayer local Button = script.Parent local RollEvent = script.Parent.Roll Button.MouseButtonDown1:Connect(function() RollEvent:FireServer() end) -- Add a Script in the same Parent as the LocalScript local RollEvent = script.Parent.Roll local Minimum = 100 local Substract = 100 RollEvent.OnServerEvent:Connect(function(plr) if plr.leaderstats.Coins.Value >= Minimum then plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value - Substract else warn(plr.Name.." doesn't have enough!") end)