I am trying to make a car spawner into a tool and I'm trying to clone the car and this isn't working. There are no errors and everything works but the cloning. Assets is a folder if that changes anything.
local tool = script.Parent
local clickEvent = tool.ClickEvent
local spawnblock = game.Workspace.spawnblock
local clickEventConnection
local function createPart(location)
local work = game.Workspace
local car = game.ReplicatedStorage.Assets.Car
car.Parent = work
car:MakeJoints()
work.Car:MoveTo(spawnblock.Position)
work.Car.Archivable = true
work.Car:Clone().Parent = game.ReplicatedStorage.Assets
end
local function onClick(player, clickLocation)
createPart(clickLocation)
end
local function onEquip()
clickEventConnection = clickEvent.OnServerEvent:connect(onClick)
end
tool.Equipped:connect(onEquip)

7 comments
This entire script is all sorts of wacky
My friens wanted me to make a car spawner into a tool for his group. This is part of the script.
This is even worse,. Let me write you a whole new script.
wait, do you want the car to spawn where the player clicked or where the block is?
where the block is
I updated my solution because now I now just about everything iu need to know. I will test it out real quick to
I got it to work but the car needs to be reqelded after it's made. LIke its comletly anchored then welded the unanchored. Maybe you can figure out how to do that through a script though.