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 10 years ago

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

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
10 years ago
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
Thanks :D YellowoTide 1992 — 10y
0
Yep. ultrabug 306 — 10y
Ad