I want the bricks to return to their original position.
Issue
This works for a CFrame but when I try to revert it to the Orientation… it for some odd reason won’t work.
--Made By MillerrIAm, VersionQ & TerryMichaelBrunk
-------------Variables------------
local Event = game.ReplicatedStorage.ControlEvents.RotateLightsEvent
local MovementModule = require(game.ServerScriptService["Module Scripts | Lighting"].MovementModule)
local Enabled = false
local isRunning = false
local Num = 360
------------Main Script------------
Event.OnServerEvent:Connect(function(plr,Lights,Activate)
Enabled = not Enabled
if Enabled then
for x,v in ipairs (game.Workspace.VenueLights[Lights]:GetChildren()) do
spawn(function()
local c = v.Orientation --Issue Here
repeat
MovementModule.Tween(v,Vector3.new(v.Orientation.X,v.Orientation.Y + Num,-145),nil)
wait(0.05)
until Enabled == false
v.Orientation = Vector3.new(c) --Issue Here
end)
end
end
end)
Use CFrames instead. It is useful to read up on them.
Do this instead:
local c = v.CFrame --CFrame stores position and orientation
...
v.CFrame = c --there are other ways to do this if you don't want
v.Position = SomePosition --to change position, but I don't think this should be a big deal
Sorry for the late reply.
Does the script run through the code fully? Try and debug the script by putting a couple prints in if you haven’t already, or try printing c to see if it stores the right value.