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

Repeat doesn't stop even thought theres until?

Asked by 3 years ago

I am making an SCP game and I am scripting for SCP 173. Here's the script:

local part = script.Parent

part.Touched:Connect(function(hit)
    local hum = hit.Parent:FindFirstChild("Union")
    if hum then
        repeat
        script.Parent.Anchored = true
            print("Player see")
            wait(1)
        until hum == nil
    elseif hum == nil then
        repeat
        script.Parent.Anchored = false
            print("player ignore")
            wait(1)
        until hum
        end


    end)



i am trying to do a repeat but it just doesn't stop. Help appreciated!

0
it doesn't stop because the humanoid is never nil. You need to find an alternative to this or set the hum to nil. Instead, check if the humanoid's health is < 0. Dovydas1118 1495 — 3y
0
hum is just the random name i put for a union variables its not humanoid actually skeletonpiratejack 13 — 3y
0
Hum has no value try putting like a value into your Union and make it nothing MattVSNNL 620 — 3y

Answer this question