Script in ServerScriptService
local event1 = game.ReplicatedStorage:WaitForChild("Events").PurchaseStorage
local Money= game.Players.LocalPlayer.Money
game.ReplicatedStorage.Events.PurchaseStorage.OnServerEvent:Connect(function(plr, event1)
if Money.Value >= 10000 then
Money.Value = Money.Value - 10000
else
if Money.Value <= 9999 then
end
end
end)
Localscript
local evnt = game.ReplicatedStorage:WaitForChild("Events").PurchaseStorage
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Down:Connect(function()
if plr.Money.Value >= 10000 then
script.Parent.Parent.Parent.Parent.Parent.Parent.Success.Visible = true
wait(3)
script.Parent.Parent.Parent.Parent.Parent.Parent.Success.Visible = false
evnt:FireServer("03X")
elseif
plr.Money.Value <= 9999 then
script.Parent.Parent.Parent.Parent.Parent.Parent.Error.Visible = true
wait(3)
script.Parent.Parent.Parent.Parent.Parent.Parent.Error.Visible = false
end
end)
Any idea why this does nothing to the Money value?
game.Players.PlayerAdded:connect(function(plr)
local Money = Instance.new("IntValue", plr)
Money.Name = "Money"
Money.Value = 1000
local rubys = Instance.new("IntValue", plr)
rubys.Name = "Rubys"
rubys.Value = 10
end)

9 comments
the game wont let u troll the players
where is the localscript in?
the script is in a button in a GUI
hey Vxpper can you post your leaderstats script too if you can do that i might be able to figure it out because i deal wth these types of scripts while working on my simulator game
I will add it, the only problem is that it won
won't save or that script is just broken, I'll post one with just the basic values I wanna make a script that saves the value
but i can't seem to make them save so im just stuck at the moment
ok hold on im working something up ill give you the script with tips and stuff just hold on a few min :)
if you have any trouble with the scripts just ask ill gladly help, also if you need to know how you can award the payer something from buying Storage i can help with that other then that good luck :)