Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script changing a number to a random high didget number instead of 6?

Asked by
danglt 185
5 years ago

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)
1
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 Gey4Jesus69 2705 — 5y
0
Ok, Thank You! Upvoted your post! danglt 185 — 5y

Answer this question