local model = game.Lighting.Car
local character = game.Players.LocalPlayer.Character
local ifcar = game.Players.LocalPlayer.leaderstats.Car.Value
local a = model:clone()
function onClicked()
if ifcar == 0 then
a.Parent = game.Workspace
wait()
a:MakeJoints()
wait()
a:MoveTo(character.Torso.Position + Vector3.new(0,0,10))
ifcar = 1
elseif ifcar == 1 then
a:remove()
ifcar = 0
end
end
script.Parent.MouseButton1Click:connect(onClicked)
I have this script that mostly works fine, the only problem is that once the persons removes the car by clicking the gui again, they can't get the car back anymore. I know what the issue is, that the script can only create the clone once, but I don't know how to fix it. I can put the clone command inside the function, but then that stops the function from getting rid of the car.
Someone please help?
