Hello I have a tool that when you click anywhere on the ground, it spawns a model. Problem: The car is spawned, but when I drive it, the wheels do not turn left or right.
Script:
bin = script.Parent function onButton1Down(mouse) local model = bin.Car:clone() model.Parent = game.Workspace model:MakeJoints() model:MoveTo(mouse.hit.p) end function onSelected(mouse) mouse.Icon = "rbxasset://textures\\GunCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end bin.Selected:connect(onSelected)
How do I fix it? Thanks!
Make local script in StarterPack
Here's an example that maybe you could use
local Part =game.Workspace.Model playerMouse = game.Players.LocalPlayer:GetMouse() playerMouse.Button1Down:connect(function(Hit) local Part2 = Part:Clone() Part2.Parent = game.Workspace Part2:MakeJoints() local x = playerMouse.Hit.X local y = playerMouse.Hit.Y local z = playerMouse.Hit.Z Part:MoveTo(Vector3.new(x,y,z)) end)