I have a script that when u buy something ur money per second goes up, by +1 more than it originally was but its doing 80 instead of 6
When i buy the upgrade my persec will go from 5 to 6 then when i click it does a random high didget number around 80 or 100
money giver script
local clickable = true
script.Parent.Activated:Connect(function(plr)
if clickable then
clickable = false
local player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
player.leaderstats.Money.Value = player.leaderstats.Money.Value + player.Upgrade.persec.Value
player.leaderstats.Total.Value = player.leaderstats.Total.Value + 1
wait(5)
clickable = true
end
end)
shop
script.Parent.MouseButton1Click:Connect(function()
if game.Players.LocalPlayer.leaderstats.Money.Value >= 100 then
script.Parent.Parent.persec.Text = script.Parent.Parent.persec.Text + 1
game.Players.LocalPlayer.Upgrade.persec.Value = game.Players.LocalPlayer.Upgrade.persec.Value + 1
game.Players.LocalPlayer.leaderstats.Money.Value = game.Players.LocalPlayer.leaderstats.Money.Value - 100
end
end)

2 comments
you need to set leaderstats' values on the server side, because those changes will currently not replicate. thus, you'll need to use a remote event
Ok, Thank You! Upvoted your post!