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

Player Added (Instance Created) help?

I have this script:

local player = script.Parent.Parent

game.Players.PlayerAdded:connect(function(player)
	local player = script.Parent.Parent
	Instance.new("SpotLight", player)
	player.Head.SpotLight.Name = ("Flashlight")
	wait()
	player.Head.FlashLight.Angle = (120)
	player.Head.FlashLight.Brightness = (.85)
end)

and no matter what I try I cannot get a player added function to work. If you could give an example of PlayerAdded:connect it would be much appreciated :)

1 answer

✓ Accepted answer
game.Players.PlayerAdded:connect(function(player)
	message=Instance.new("Message")
	message.Text=player.Name.." has entered the game!"
	message.Parent=game.Workspace
	wait(5)
	message:Destroy()
end)

2 comments

2

Thanks :D

0

Yep.

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