Ok so i have a problem when someone Equip the tool on my stats it goes 1 per sec but
if someone spam the tool and after have t equiped it gived like 100 depends on how maney times you equiped and unequip spammed the tool
Script:
local player = game:GetService("Players"):WaitForChild(script.Parent.Parent.Parent.Name)
local meditating = false
script.Parent.Equipped:Connect(function()
meditating = true
while wait(1.5) do
if meditating == true then
player.PsychicPower.Value = player.PsychicPower.Value + 1 * player.PPMulti.value*player.PPZoneMulti.Value
end
end
end)
script.Parent.Unequipped:Connect(function()
meditating = false
end)
local player = game:GetService("Players"):WaitForChild(script.Parent.Parent.Parent.Name)
local meditating = false
script.Parent.Equipped:Connect(function()
meditating = true
while wait(1.5) do
if meditating == true then
player.PsychicPower.Value = player.PsychicPower.Value + 1 * player.PPMulti.value*player.PPZoneMulti.Value
else
break/return
end
end
end)
script.Parent.Unequipped:Connect(function()
meditating = false
end)
while wait(1.5) do
if meditating == true then
player.PsychicPower.Value = player.PsychicPower.Value + 1 * player.PPMulti.value*player.PPZoneMulti.Value
else
Break
end
end
while wait(1.5) do
if meditating == true then
player.PsychicPower.Value = player.PsychicPower.Value + 1 * player.PPMulti.value*player.PPZoneMulti.Value
else
return
end
end
local player = game:GetService("Players"):WaitForChild(script.Parent.Parent.Parent.Name)
local meditating = false
script.Parent.Equipped:Connect(function()
meditating = true
while wait(1.5) do
if meditating == true then
player.PsychicPower.Value = player.PsychicPower.Value + 1 * player.PPMulti.value*player.PPZoneMulti.Value
else
break
end
end
end)
script.Parent.Unequipped:Connect(function()
meditating = false
end)
there that it was it could look like
with a lowercase b for break
hmmmmm this is confusing as the while loop is constantly being called and not stopped meaning it duplicates the + 1 but a break or return should stop that