Ive made this code below and it duplicates the car from server storage and spawns it in a certain place, my problem is if someone is to spawn a different car the old one will still be there and the spawn button can be pressed multiple times and the cars will spawn on each other is there a way I could alter this script?
script.Parent.MouseButton1Click:connect(function(GetCar) Mod = game.ServerStorage.BMW330DCIV clone = Mod:clone() clone.Parent = workspace clone:MakeJoints() end)
I also have a local script in the button too which teleports the player to the car and deactivates the Gui which is here
local Button = script.Parent Button.MouseButton1Click:Connect(function() local player = game.Players.LocalPlayer player.Character.HumanoidRootPart.CFrame = CFrame.new(-19.3, 1.05, 57.68) script.Parent.Parent.Parent.Enabled = false end)
thanks