Hello, my script here does not seem to be working. What I want is that when the textbutton is clicked I want the car to spawn infont of the block not the script. Therefore I have used a click detector to open the gui. but this part is not working, any help?
The “CHPCVnon” is the model I want to spawn.
model = script.Parent.Parent.CHPCVnon
modelbackup = model:Clone()
r = false
function onclicked()
if (r == true) then return end
r = true
modelbackup = modelbackup:Clone()
model:remove()
wait(1)
modelbackup.Parent = script.Parent.Parent
modelbackup:MakeJoints()
model = modelbackup
modelbackup = model:Clone()
wait(5)
r = false
end
script.Parent.ClickDetector.MouseClick:connect(onclicked)
Owo chp crown vic. In order to spawn a vehicle you must respect FE so the clickdetector should have fired a event that spawned a car in a server script.