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 4 years ago

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

01local part = script.Parent
02 
03part.Touched:Connect(function(hit)
04    local hum = hit.Parent:FindFirstChild("Union")
05    if hum then
06        repeat
07        script.Parent.Anchored = true
08            print("Player see")
09            wait(1)
10        until hum == nil
11    elseif hum == nil then
12        repeat
13        script.Parent.Anchored = false
14            print("player ignore")
15            wait(1)
16        until hum
17        end
18 
19 
20    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 — 4y
0
hum is just the random name i put for a union variables its not humanoid actually skeletonpiratejack 13 — 4y
0
Hum has no value try putting like a value into your Union and make it nothing MattVSNNL 620 — 4y

Answer this question