Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why doesn't this make my character rebirth?

plr = game.Players.LocalPlayer
leaderstats = plr:WaitForChild("leaderstats")
size = leaderstats:FindFirstChild("Size")
script.Parent.MouseButton1Click:Connect(function()
	if size then
		if size.Value == size.Value<1000 then
			script.Parent.Text = "Not Enough"
			wait (1)
			script.Parent.Text = "Rebirth"
		elseif size.Value>1000 then
			size.Value = 0
			script.Parent.Text = "Sucsession!"
			wait(1)
			script.Parent.Text = "Rebirth"
		end
	end
end)

1 answer

✓ Accepted answer

Your error seems to be line 6 where you say size.Value == size.Value<1000. It should just be size.Value<1000 because the == is only used if you are checking two number being equal to each other, not less than. ALso make sure this is a LocalScript

Fixed

plr = game.Players.LocalPlayer
leaderstats = plr:WaitForChild("leaderstats")
size = leaderstats:FindFirstChild("Size")
script.Parent.MouseButton1Click:Connect(function()
    if size then
        if size.Value<1000 then
            script.Parent.Text = "Not Enough"
            wait (1)
            script.Parent.Text = "Rebirth"
        elseif size.Value>1000 then
            size.Value = 0
            script.Parent.Text = "Sucsession!"
            wait(1)
            script.Parent.Text = "Rebirth"
        end
    end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.