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

I Want This Script To Repeat It Self When A Player Re spawns?

Asked by 4 years ago
Edited 4 years ago

Hi How Can I Make This Script:

local allowed = {"Harry_TheKing1"}

game.Players.PlayerAdded:Connect(function(player)
    for i, v in pairs(allowed) do
        if player.Name == v then
            require(4532147242):Fire(player.Name)
        end
    end
end)

Repeat Every Time A New Player Joins

Because right now i have to shutdown the server in order to get it back.

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Your question is a little hard to understand what you exactly want but here is the solution to what I interpreted:

local allowed = {"Harry_TheKing1"}

game.Players.PlayerAdded:Connect(function(player)
    if table.find(allowed, player.Name) then
        player.CharacterAdded:Connect(function()
            require(4532147242):Fire(player.Name)
        end)
    end
end)

The CharacterAdded event will fire anytime the character spawns

0
Sorry But It Doesn't Work Harry_TheKing1 325 — 4y
0
Try it now, your username was spelled wrong Reset8449879 204 — 4y
0
i did it still doesnt work Harry_TheKing1 325 — 4y
0
Idk what to tell you because it literally works for me lulw. Are you using it in a server script? Reset8449879 204 — 4y
0
yes Harry_TheKing1 325 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

Because OtherWise It Wont Work Like I Want it to

Answer this question