local MainCFrame1 = script.Parent:GetPrimaryPartCFrame() while game:GetService("RunService").Heartbeat:wait() do local sin, rad = math.sin, math.rad local t = tick() local newCFrame1 = MainCFrame1 * CFrame.new(sin(t*1.8)*.5, (sin(t*1.6)*.5), (sin(t*2)*.5) * CFrame.Angles(rad(sin(t*3) * 2), rad(sin(t*3.2) * 4), rad(sin(t*3) * 6))) script.Parent:SetPrimaryPartCFrame(newCFrame1) end
Output says
bad argument #1 to '?' (CFrame expected, got number)
Any ideas on how to fix this?
Your parenthesis are messed up, there should be another parenthesis at the end of the first CFrame. I fixed it and tested it for you. Here you go.
local MainCFrame1 = script.Parent:GetPrimaryPartCFrame() while game:GetService("RunService").Heartbeat:wait() do local sin, rad = math.sin, math.rad local t = tick() local newCFrame1 = MainCFrame1 * CFrame.new(sin(t*1.8)*.5, (sin(t*1.6)*.5), (sin(t*2)*.5)) * CFrame.Angles(rad(sin(t*3) * 2), rad(sin(t*3.2) * 4), rad(sin(t*3) * 6)) script.Parent:SetPrimaryPartCFrame(newCFrame1) end
let me know if there are any issues.