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

what can i use instead of this?

Asked by
Benqazx 108
8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
while true do
    wait(10)
    local player = script.Parent.Parent.Parent.Name
    local check = game.Workspace.Checkpoint1:FindFirstChild(player)
    if check == nil then
        if game.Workspace:FindFirstChild(player).Humanoid.LocalBin == nil then
            script.Parent.Disabled = true
            script.Disabled = true
        elseif game.Workspace:FindFirstChild(player).Humanoid.LocalBin ~= nil then
            game.Workspace:FindFirstChild(player).Humanoid.LocalBin:Destroy()
            script.Parent.Disabled = true
            script.Disabled = true
        end
    end
end

there is a problem with this 'while true do'. when this script is active it looks for the checkpoint in workspace and if there is no player name in there it deletes the localbin and then the script gets disabled. but when its active again it only gives around 5 seconds or below instead of 10. is there another way i could do this script?

0
A script cannot re-enable itself after it has been disabled, obviously. It's like trying to get a dead body to re-animate itself. TheDeadlyPanther 2460 — 8y
0
wait i will make a game to show you. idk it might be just me but can you follow? Benqazx 108 — 8y
0
Panther has a point, you once a script has been disabled, it stops, and nothing inside of it will run. You need a seperate script to re-enable the script NinjoOnline 1146 — 8y

Answer this question