Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Ship not spawning after a while? [SOLVED]

Asked by 6 years ago
Edited 6 years ago

In games it breaks after a while I have no idea why. Is there a better way of spawning things in? - thanks

debounce = true






script.Parent.Touched:connect(function(hit)
    if debounce == true then
        debounce = false
    local hum = hit.Parent:FindFirstChild("Humanoid")
        if hum ~= nil then
        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
        local treasure = player.leaderstats.Treasure
        if treasure.Value == 0 or treasure.Value > 0 then
            treasure.Value = treasure.Value - 0
            local ship1 = game.ReplicatedStorage.Ship1:Clone()
    ship1.Parent = Workspace 
    ship1:MakeJoints()
wait(8)
debounce = true
else
            debounce = true
        end

        end
    end
end)

I solved it by respawning the spawners every 120 seconds incase they broke if anyone has this problem in the future.

0
Ty Radstar1 270 — 6y

Answer this question