So I have a script that should play some animations onn a boolvalue.changed event, and in that script im using this kind of line of code:
for i,v in pairs() do
end
But with the following
Script
local value = script.Parent.Activated
local activate = workspace.Tower2.Lyoko:LoadAnimation(script.Activate)
local idle = workspace.Tower2.Lyoko:LoadAnimation(script.Idle)
local deactivate = workspace.Tower2.Lyoko:LoadAnimation(script.DeActivate)
value.Changed:Connect(function()
if value.Value == true then
activate:Play()
for i, v in pairs(script.Parent:GetChildren()) do
if v.Name == "Neon" then
v.BrickColor = BrickColor.new("Really red")
end
wait(1.5)
idle:Play()
end
else
for i, v in pairs(script.Parent:GetChildren()) do
if v.Name == "Neon" then
v.BrickColor = BrickColor.new("Institutional white")
end
wait(1)
deactivate:Play()
end
end
end)
the neon coloring runs very slow.
Here is a video of what i mean:
and it goes on until every neon part is red.
any help?