Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

5 comments

0

Sorry But It Doesn't Work

0

Try it now, your username was spelled wrong

0

i did it still doesnt work

0

Idk what to tell you because it literally works for me lulw. Are you using it in a server script?

0

yes

This discussion is preserved as it was. New answers, comments, and votes are closed.