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

Player Added (Instance Created) help? [closed]

Asked by 11 years ago

I have this script:

01local player = script.Parent.Parent
02 
03game.Players.PlayerAdded:connect(function(player)
04    local player = script.Parent.Parent
05    Instance.new("SpotLight", player)
06    player.Head.SpotLight.Name = ("Flashlight")
07    wait()
08    player.Head.FlashLight.Angle = (120)
09    player.Head.FlashLight.Brightness = (.85)
10end)

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 :)

Locked by JesseSong, Void_Frost, and youtubemasterWOW

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
4
Answered by
ultrabug 306 Moderation Voter
11 years ago
1game.Players.PlayerAdded:connect(function(player)
2    message=Instance.new("Message")
3    message.Text=player.Name.." has entered the game!"
4    message.Parent=game.Workspace
5    wait(5)
6    message:Destroy()
7end)
2
Thanks :D YellowoTide 1992 — 11y
0
Yep. ultrabug 306 — 11y
Ad