I skidded a rebirth script but idk how to really use it I tried doing this
if game.Players.localplayer.leaderstats.Rebirths.Value == 1 then do
db = true
animtrack1:Play()
plr.leaderstats.Strength.Value = plr.leaderstats.Strength.Value + 2
wait(_M.cooldown)
db = false
end
but it didnt work so here is the whole script
local _M = require(script.Parent.Settings)
local db = false
local tool = script.Parent
repeat wait() until tool.Parent.Parent:IsA("Player")
local plr = tool.Parent.Parent
local character = plr.Character
local anim1 = tool:WaitForChild("LiftAnim")
local animtrack1 = character.Humanoid:LoadAnimation(anim1)
local anim2 = tool:WaitForChild("IdleAnim")
local animtrack2 = character.Humanoid:LoadAnimation(anim2)
tool.Activated:Connect(function()
if not db then
db = true
animtrack1:Play()
plr.leaderstats.Strength.Value = plr.leaderstats.Strength.Value + _M.strengthPerClick
wait(_M.cooldown)
db = false
end
end)
tool.Equipped:Connect(function()
character.Humanoid.WalkSpeed = 0
animtrack2:Play()
end)
tool.Unequipped:Connect(function()
character.Humanoid.WalkSpeed = 16
animtrack2:Stop()
end)
In the line where you wrote plr.leaderstats.Strength.Value = plr.leaderstats.Strength.Value x 2, if you’re trying to multiply, use the * symbol. Also for the line game.Players.localplayer.leaderstats.Rebirths.Value >= 1 then do, in Lua, you write if (condition) then (there’s no need for the do) so you could rewrite the line as if plr.leaderstats.Rebirths.Value >= 1 then. Just make sure you already defined plr.
local _M = require(script.Parent.Settings)
local db = false
local tool = script.Parent
repeat wait() until tool.Parent.Parent:IsA("Player")
local plr = tool.Parent.Parent
local character = plr.Character
local anim1 = tool:WaitForChild("LiftAnim")
local animtrack1 = character.Humanoid:LoadAnimation(anim1)
local anim2 = tool:WaitForChild("IdleAnim")
local animtrack2 = character.Humanoid:LoadAnimation(anim2)
tool.Activated:Connect(function()
if not db then
if plr.leaderstats.Rebirths.Value >= 1 then
db = true
animtrack1:Play()
plr.leaderstats.Strength.Value = plr.leaderstats.Strength.Value *2
wait(_M.cooldown)
db = false
end
end
tool.Equipped:Connect(function()
character.Humanoid.WalkSpeed = 0
animtrack2:Play()
end)
tool.Unequipped:Connect(function()
character.Humanoid.WalkSpeed = 16
animtrack2:Stop()
end)
Maybe the leaderstats value is 0? You are multiplying the leaderstats value by 2, and 0x2 = 0. Try changing it to 2 or something to see if it is changing the value.
local _M = require(script.Parent.Settings)
local db = false
local tool = script.Parent
repeat wait() until tool.Parent.Parent:IsA("Player")
local plr = tool.Parent.Parent
local character = plr.Character
local anim1 = tool:WaitForChild("LiftAnim")
local animtrack1 = character.Humanoid:LoadAnimation(anim1)
local anim2 = tool:WaitForChild("IdleAnim")
local animtrack2 = character.Humanoid:LoadAnimation(anim2)
tool.Activated:Connect(function()
if not db then
if plr.leaderstats.Rebirths.Value >= 1 then
db = true
animtrack1:Play()
plr.leaderstats.Strength.Value = plr.leaderstats.Strength.Value *2
wait(_M.cooldown)
db = false
end
end
end)
tool.Equipped:Connect(function()
character.Humanoid.WalkSpeed = 0
animtrack2:Play()
end)
tool.Unequipped:Connect(function()
character.Humanoid.WalkSpeed = 16
animtrack2:Stop()
end)
I only added some print commands, so tell me what’s in the output this time.
local _M = require(script.Parent.Settings)
local db = false
local tool = script.Parent
repeat wait() until tool.Parent.Parent:IsA("Player")
local plr = tool.Parent.Parent
local character = plr.Character
local anim1 = tool:WaitForChild("LiftAnim")
local animtrack1 = character.Humanoid:LoadAnimation(anim1)
local anim2 = tool:WaitForChild("IdleAnim")
local animtrack2 = character.Humanoid:LoadAnimation(anim2)
print("Loaded")
tool.Activated:Connect(function()
print("Activated")
if not db then
print("Debounce False")
if plr.leaderstats.Rebirths.Value >= 1 then
print("Rebirthed")
db = true
animtrack1:Play()
plr.leaderstats.Strength.Value = plr.leaderstats.Strength.Value * 2
wait(_M.cooldown)
db = false
end
end
end)
tool.Equipped:Connect(function()
character.Humanoid.WalkSpeed = 0
animtrack2:Play()
end)
tool.Unequipped:Connect(function()
character.Humanoid.WalkSpeed = 16
animtrack2:Stop()
end)