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

When I rebirth it sets my rebirth to 2501 when its suppose add 1 at a time what shoud i do?

Asked by 4 years ago
local open = false
local player = game.Players.LocalPlayer

script.Parent.RebirthButton.MouseButton1Click:Connect(function()
    if open == false then
        script.Parent.Frame.Visible = true
        script.Parent.Frame.Requirements.Text = "You need "..(player.leaderstats.Rebirths.Value+1*2500).." to rebirth."
        open = true
    else
        script.Parent.Frame.Visible = false
        open = false        
    end
end)

script.Parent.Frame.RebirthButton.MouseButton1Click:Connect(function()
    if player.leaderstats.Cash.Value >= ((player.leaderstats.Rebirths.Value*1)*2500) then
        game.ReplicatedStorage.RemoteEvents.Rebirth:FireServer()
        player.leaderstats.Cash.Value = 0
        player.leaderstats.Rebirths.Value = player.leaderstats.Rebirths.Value + 1
        script.Parent.Frame.RebirthButton.Text = "You have Rebirthed Succesfully"
        wait(2)
        player.leaderstats.Rebirths.Value = player.leaderstats.Rebirths.Value + 2500
        script.Parent.Frame.Visible = false
        open = false
        script.Parent.Frame.RebirthButton.Text = "Rebirth"
    end
end)
0
You do realise that on line 22, you made it add 2,500 instead of 1? Maybe try that/ aadenboy 17 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You need to remove line 22 because it is saying that it is adding 2500 to rebirths.

Ad

Answer this question