i have a script here that functions with cash and rebirths and the issue is when i reach 100 or more i get 1 rebirth
but if i reach 200 it doesn’t give me 2 rebirths (depends on if the player clicks button twice) same with 300 or more And if possible please make me a tween for my text i have made one before but doesn’t work, thank you:
x = script.Parent
plr = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
leaderstats = plr.leaderstats
reb = leaderstats.Rebirths
cash = leaderstats.Clicks
txt = x.Parent.Warning
x.MouseButton1Click:Connect(function()
if cash.Value >= 100 then
reb.Value = reb.Value + 1
cash.Value = 0
print(plr.Name.. " Has Got".. reb.Value.. " Worth Of Rebirth (s) ! Keep Going !")
else
print("Not Enough Clicks To Rebirth! Try After Getting 100 Clicks !")
txt.Visible = true
wait(2)
txt.Visible = false
end
end)
The problem is that you are only adding 1 rebirth instead of using a formula to calculate how many rebirths should be added
local x = script.Parent
local plr = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local leaderstats = plr.leaderstats
local reb = leaderstats.Rebirths
local cash = leaderstats.Clicks
local txt = x.Parent.Warning
x.MouseButton1Click:Connect(function()
if cash.Value >= 100 then
reb.Value += math.floor(cash/100)
cash.Value = 0
print(plr.Name.. " Has Got".. reb.Value.. " Worth Of Rebirth (s) ! Keep Going !")
else
print("Not Enough Clicks To Rebirth! Try After Getting 100 Clicks !")
txt.Visible = true
task.wait(2)
txt.Visible = false
end
end)
the script isn’t supposed to rebirth all of the money cuz its 200 it needs to rebirth 100 of it and if the player rebirths 2nd time he will have 0 cash 2 rebirths