#Ferrarico tanks system

1 messages · Page 1 of 1 (latest)

lime wadi
#

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)

wide trail
lime wadi
wide trail
lime wadi
#

i tried to use serverstorage but it's not working x)

#

well it's spawning it but, the tank don't worked when using serverstorage

#

do you want to see how it made the model ?

wide trail
lime wadi
#

yeah cuz the folder is moved into replicatedstorage when the game started

#

it's moved in from this :

#

do you think if i replace replicatedstorage to serverstorage it would worked ? @wide trail

wide trail
#

just focus on exactly what the problem is. you said something about spawning a tank twice?

#

tell me about that.

lime wadi
#

do you think we can go in a voice chat, i'm gonna show u

#

come in private @wide trail

wide trail
lime wadi
#

yeah mb sorry

lime wadi
#

@wide trail forget it, i made the tank spawning multiple

#

it wasn't that hard x) sorry for disturbing you

wide trail
lime wadi
lime wadi
wide trail
wide trail
lime wadi
#

tree friddy ? i'm not english so i don't understand this x)

wide trail
#

depends on the job bruh agony

lime wadi
#

just teaching me