Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why doesn't my repeat wait() until work in this function?

function ontouched(part)
local hum = part.Parent:FindFirstChild("Humanoid")
if hum and game.Players:GetPlayerFromCharacter(part.Parent) and hum ~= nil then
local gui1 = game.Players:GetPlayerFromCharacter(part.Parent):WaitForChild("PlayerGui"):WaitForChild("Gui4"):WaitForChild("Frame")
local gui2 = game.Players:GetPlayerFromCharacter(part.Parent):WaitForChild("PlayerGui"):WaitForChild("Gui5"):WaitForChild("Frame")
local gui3 = game.Players:GetPlayerFromCharacter(part.Parent):WaitForChild("PlayerGui"):WaitForChild("Gui6"):WaitForChild("Frame")
game.Workspace.Dummy.Torso.Anchored = false
script.Parent.Position = Vector3.new(-50,50,50)
gui1.label1.Visible = false
gui2.label1.Visible = true
gui2.label1:Destry()
repeat wait() until game.Workspace.Dummy.Humanoid.Health == 0
gui3.label1.Visible = true
game.StarterPack.Sword.Enabled = true
wait(4)
end
end
script.Parent.Touched:connect(ontouched)

3 comments

0

Why downvote? It's legitimate question. qq

1

Look closely at line 11.

0

Thanks.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.