Hello, Scripting Support. I once again request your help. I am trying to figure out how to change attachments CFrame using if statements , i already have a script that is supposed to Change the CFrame but it does’t do it with no errors. Here is the script , and its the CFrame of an attachment not a part.
local nyc = game.Workspace:WaitForChild("nycbeam")
local attachment = game.Workspace.nycbeam:WaitForChild("Attachment2")
task.spawn(function()
while true do
local deltaTime = game:GetService("RunService").Heartbeat:Wait()
attachment.WorldCFrame += Vector3.new(0, 0, deltaTime * 0.1)
end
end)
if attachment.WorldCFrame.Position == Vector3.new(0, 0, -53.498) then
attachment.CFrame = CFrame.new(0, 0, -55.828)
end