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

How to activate Rebirth Button on Click?

Asked by 4 years ago

Hey! I'm new to scripting and I believe to have my Rebirth GUI set up correctly. Upon clicking, it opens the Rebirth Menu (showing the amount needed to rebirth, and a clickable button to rebirth). When you click to Rebirth, it is supposed to either say "you need more strength!" or "Successfully Rebirthed", and then complete the rebirth. For some reason, when I click the button, nothing happens even if I have the required amount... Can anyone tell what I'm missing or where I went wrong?:

rebirthButton.MouseButton1Click:Connect(function()
    local result = replicatedStorage.Remotes.Rebirth:InvokeServer()

    if result == true then
        rebirthButton.Text = "Successfully Rebirthed"
        wait(1)
        rebirthButton.Text = "CLICK HERE TO REBIRTH"
    elseif result == "NotEnoughStrength" then
        rebirthButton.Text = "Not Strong Enough!"
        wait(1)
        rebirthButton.Text = "CLICK HERE TO REBIRTH"
    end
end)

rebirths:GetPropertyChangedSignal("Value"):Connect(function()
    strengthToRebirth.Text = "You need at least "..math.floor((starterRebirthAmount +   (rebirths.Value) * math.sqrt(5000000))).." strength to rebirth"
end)

1 answer

Log in to vote
0
Answered by
Ga7in6 5
4 years ago

Do you have leaderstats? Because that's the only problem I see, I'm a beginner too but do you have leaderstats?

Ad

Answer this question