I made a script where alarms would go off and make that zone go into lockdown but the only thing that is not working is things not rotating.
local alarms = {}
for i,v in pairs(workspace.AlarmS1:GetDescendants()) do
if v:IsA('PointLight') or v:IsA('SurfaceLight') or v:IsA('SpotLight') then
table.insert(alarms,v)
end
end
for i,v in pairs(alarms) do
Bool.Changed:Connect(function()
if Bool.Value == true then
while true do
wait(2)
print("Yes")
v.Parent.Orientation = v.Parent.Orientation + Vector3.new(1, 0, 0)
end
end
end)
end
Theories:
I am thinking that the script is working fine but the problem is it is causing enough lag to the server that it makes it take time to rotate. Even if it was this problem, I don’t know what would be the method to make it not lag with the for.