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

elseifs in this script are broken?

Asked by 9 years ago

only the first if works but if the first if doesnt work, it doesn't even check the rest of the elseifs please help me

killsafe.Changed:connect(function()
while killsafe.Value == true do
wait()
for _, v in pairs(script.Parent:GetChildren()) do 
if safe1.Value == false then 
if v:findFirstChild("ball") then
if v.ball.Parent.Name == part1.Name then
d1.Parent = v.ball.Parent
del.Value = true
print("safe")
end
end
-- SCRIPT DOESNT WORK AFTER THIS 
elseif safe2.Value == false then
if v:findFirstChild("ball") then
if v.ball.Parent.Name == part2.Name then
d1.Parent = v.ball.Parent
del.Value = true
print("safe")
end
end
elseif safe3.Value == false then
if v:findFirstChild("ball") then
if v.ball.Parent.Name == part3.Name then
d1.Parent = v.ball.Parent
del.Value = true
print("safe")
end
end
end 
end 
end
end)
1
... what is this supposed to accomplish? BlueTaslem 18071 — 9y
0
Set the value of safe1 to false or it will never continue to your elseif. RepeatLua 90 — 9y

Answer this question