Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I am trying to make a tool that spawns a model but it gives me an error. How to fix?

I am trying to make a tool that clones a model but I get an error saying CFrame is not a valid member of Model

My code

local item = script.Parent
local printer = game.Workspace["Test Printer"]

script.Parent.Activated:Connect(function()
	local newprinter = printer:Clone()
	newprinter.Name = "Printer"
	newprinter.Parent = game.Workspace
	newprinter.CFrame = script.Parent.Handle.Position + Vector3.new(10, 0, 0)
	newprinter.Getmony.GetCash.Disabled = false
	
	script.Parent:Destroy()
end)

Edit: I fixed it by changing Cframe to SetPrimaryPartCframe

2 answers

newprinter:MoveTo(script.Parent.Handle.Position + Vector3.new(10, 0, 0))

That Might do it :)

1 comment

0

I fixed it using setprimarypartcframe

I fixed it. I was using cframe instead of setprimarypartcframe

local item = script.Parent
local printer = game.Workspace["Test Printer"]

script.Parent.Activated:Connect(function()
	local newprinter = printer:Clone()
	newprinter.Name = "Printer"
	newprinter.Parent = game.Workspace
	newprinter:SetPrimaryPartCFrame(CFrame.new(script.Parent.Handle.Position))
	newprinter.Getmony.GetCash.Disabled = false
	
	script.Parent:Destroy()
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.