You can write your topic however you want, but you need to answer these questions:
-
**Well i have looking at this script and i think it have i wanted.
-
**The issue is that when the car is generated, and if someone generates another car, it will simply bug out. i would hope if someone could help me with it.
local Cloned = 0
local CloneMax = 5
local CanClone = true
local Black = 26
local Purple = 104
local CarName = "Bus"
local WaitTime = 0.01
script.Parent.Spawned.Surface.Text.Text = "Spawned: ".. Cloned.. "/".. CloneMax
script.Parent.Type.Surface.Text.Text = "Vehicle: ".. CarName
function Check()
if Cloned < CloneMax then
if CanClone == true then
local CarClone = game.ServerStorage:FindFirstChild(CarName):Clone()
CarClone.Parent = script.Parent
Cloned = Cloned + 1
script.Parent.Spawned.Surface.Text.Text = "Spawned: ".. Cloned.. "/".. CloneMax
script.Parent.Spawner.BrickColor = BrickColor.new(26)
CanClone = false
wait(WaitTime)
CanClone = true
script.Parent.Spawner.BrickColor = BrickColor.new(104)
if Cloned == CloneMax then
script.Parent.Spawner.BrickColor = BrickColor.new(26)
end
end
end
end
script.Parent.Spawner.ClickDetector.MouseClick:connect(Check)