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

Is there a more affective way to use this script?

Asked by 5 years ago

Basically when someone leaves it makes the door not owned anymore but only for that certain person. Thing is sometimes it doesn't catch it fast enough but I want it instantly to make the game seem clean.

game.Players.ChildRemoved didn't work so thats not a option. Is there a better way for this?

Script: ServerScript in the model.

function StartCount()
    wait(2)
    if game.Players:FindFirstChild(script.Parent.Parent.Owner.GUI.Owner.Player.Value) == nil then
        script.Parent.Owned.Value = false
    end
end

game.Players.PlayerRemoving:Connect(StartCount)
0
Please provide more details, such as the script type and location of script, as well as any output errors/warnings. User#19524 175 — 5y
0
I guess the wait is slowing it down.. But I think you may need it, beacause the player name may not have been removed from the players yet. Not quite sure. TheWaterFoox 255 — 5y
0
There are no errors, I jsut want to know a more effective way to remove it. The wait() is slowing it down. Sergiomontani10 236 — 5y

Answer this question