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

Having trouble getting this script to damage players only one time per resize?

Asked by
Azuc 112
6 years ago

Basically when my core overheats at temp 1199 it will resize then shrink back to normal and repeat basically when its growing I want anyone it touches to take -10 damage but only once per growth, so after it resets back to normal size and starts to expand again it should be able to damage them again.

Right now it only damages everyone once the very first time it expands then nothing for any others.

local debounce = false
local Temp = script.Parent.Parent.Parent.Parent.VALUES:WaitForChild("Temp")

while true do
    if Temp.Value >= 1199 then
        for i=1, 90 do
        script.Parent.Size = script.Parent.Size + Vector3.new(9,9,9)
        wait(0.01)
        end
        script.Parent.Size = Vector3.new(12.455,12.455,12.455)
        end
    wait()
end


function lava(hit)
if debounce == false then
    local humanoid = hit.Parent:FindFirstChild("Humanoid")
    if humanoid ~= nil then
    humanoid.Health =  humanoid.Health  - 10
    wait(1)
    end
end
end

script.Parent.Touched:connect(lava)
0
Is this the full script? Meltdown81 309 — 6y

Answer this question