Hello,
Basically, what I was looking for was... Let's say that there is a part I have a tool and I select the tool. And I then click on the part (with tool selected) and the car spawns on top of the part.
I found a free model and I've tried changing it spawn a car, but I cannot.
Here is the original script under the tool: -----v
bin = script.Parent
function onButton1Down(mouse)
local model = bin.TestFigure:clone() model.Parent = game.Workspace model:MakeJoints() model:MoveTo(mouse.hit.p)
end
function onSelected(mouse) mouse.Icon = "rbxasset://textures\ArrowCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
bin.Selected:connect(onSelected)
Thank you for reading. :-) ~~Mechanizationized
There is a mistake in line 5
, You put :MoveTo
and MoveTo is not a valid member of Part, so I changed it using your script, I used the CFrame
(CFrame.new):
bin = script.Parent function onButton1Down(mouse) local model = bin.TestFigure:clone() model.Parent = game.Workspace model:MakeJoints() model.CFrame=CFrame.new(mouse.hit.p)-- <--- end function onSelected(mouse) mouse.Icon = "rbxasset://textures\ArrowCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end bin.Selected:connect(onSelected)
Hope this helps!