i want this model called Killer to move to the model called Dyno
here is my script so far:
local model = workspace.Dyno model.PrimaryPart = model:FindFirstChild("middlePart") local Offset = model:GetPrimaryPartCFrame() local replicatedStorage = game:GetService("ReplicatedStorage") local killB = replicatedStorage.Killer local copy = killB:Clone() copy.Parent = model.Parent copy.Name = "Explosions" copy.PrimaryPart = copy:FindFirstChild("Part") copy:SetPrimaryPartCFrame(CFrame.new(Offset))
whenever i run it it says: 15:20:45.971 - Workspace.Dyno.Sticks.Script:10: bad argument #1 to 'new' (Vector3 expected, got CFrame)
please help
Well the reason this error is appearing is that you are trying to convert a cframe into another cframe.
the reason for this is the CFrame.new here :
copy:SetPrimaryPartCFrame(CFrame.new(Offset))
as you already defined Offset as model:GetPrimaryPartCFrame()
, and CFrame.new() doesn't accept another cframe as a parameter in any form, it will error.
To get around this, you could just get rid of the cframe.new:
local Offset = model:GetPrimaryPartCFrame() copy:SetPrimaryPartCFrame(Offset)