Hello everyone, does anyone know how to modify the Ferrarico respawner so that it can spawn the same tanks multiple times?
The script :
local Gui = script.RespawnGui
local Group = script.Parent.Parent.Parent
local RespPoint = Group.Platform.RespawPoint
local function SpawnNew(plyr,img,size,color,label)
script.Disabled = true
script.Parent.Color = Color3.fromRGB(30, 30, 30)
script.Parent.Parent.Blueprint.Color = Color3.fromRGB(30, 30, 30)
script.Parent.BillboardGui.Enabled = false
script.Parent:SetAttribute("CanRespawn",false)
if Group:FindFirstChild("Tank") then
Group.Tank:Destroy()
end
local newTonk = game.ReplicatedStorage.TankStuff.Tank:Clone()
newTonk.Parent = Group
newTonk.PrimaryPart = newTonk.RespawPoint
newTonk:SetPrimaryPartCFrame(CFrame.new(RespPoint.Position))
newTonk:SetPrimaryPartCFrame(CFrame.new(newTonk.RespawPoint.Position, newTonk.RespawPoint.Position + RespPoint.CFrame.LookVector)+Vector3.new(0,2,0))
newTonk.RespawPoint:Destroy()
for _, child in pairs (newTonk:GetDescendants()) do
if child:IsA("BasePart") and (child.Parent.Name == "Color" or child.Name == "Color" or child.Name == "DoorHinge" or child.Name == "FixedAttach" or child.Name == "Connector" or child.Name == "DoorPanel" or child.Name == "Launcher" or child.Name == "MGHinge") then
child.Color = color
end
end
newTonk.Chassi.Turret.Structure.EmblemPart.SurfaceGui.ImageLabel.Image = img
newTonk.Chassi.Turret.Structure.EmblemPart.SurfaceGui.ImageLabel.Size = UDim2.new(size,0,size,0)
local filteredMessage = game:GetService("Chat"):FilterStringForBroadcast(label, plyr)
newTonk.Chassi.Turret.Structure.LabelPart.SurfaceGui.TextLabel.Text = filteredMessage
local Structure = newTonk.Chassi.Structure
local Turret = newTonk.Chassi.Turret
local Wheels = newTonk.Wheels
local Tracks = newTonk.Tracks
wait(1)
for _, child in pairs(Wheels:GetChildren()) do
if child.Name == "WheelSusp." then
child.Connector.Anchored = false
wait(0.01)
end
end
for _, child in pairs(Tracks.TrackLeft:GetChildren()) do
child.Anchored = false
end
for _, child in pairs(Tracks.TrackRight:GetChildren()) do
child.Anchored = false
end
Structure.qPerfectionWeld.Disabled = false
wait(0.5)
Turret.Structure.qPerfectionWeld.Disabled = false
Turret.Cannon.qPerfectionWeld.Disabled = false
print("respawned tank")
wait(15)
script.Parent.Color = Color3.fromRGB(162, 158, 147)
script.Parent.Parent.Blueprint.Color = Color3.fromRGB(162, 158, 147)
script.Parent.BillboardGui.Enabled = true
script.Parent:SetAttribute("CanRespawn",true)
script.Disabled = false
end
script.RespawnTankEvent.OnServerEvent:Connect(function(plyr,img,size,color,label)
if Group:FindFirstChild("Tank") then
if Group.Tank:FindFirstChild("Chassi") and Group.Tank.Chassi:FindFirstChild("Structure") and Group.Tank.Chassi.Structure:FindFirstChild("DriverSeat") and Group.Tank.Chassi.Structure.DriverSeat:FindFirstChild("Seat") then
if Group.Tank.Chassi.Structure.DriverSeat.Seat.Occupant == nil then
SpawnNew(plyr,img,size,color,label)
end
else
SpawnNew(plyr,img,size,color,label)
end
else
SpawnNew(plyr,img,size,color,label)
end
end)
function GiveGui(plyr)
local newGui = Gui:Clone()
newGui.Respawner.Value = script.Parent.Parent.Parent
newGui.Parent = plyr.PlayerGui
newGui.MainFrame.GeneralScript.Disabled = false
end
script.Parent.Parent.ClickDetector.MouseClick:Connect(function(plyr)
GiveGui(plyr)
end)

