|
| 11 Jan 2014 11:06 AM |
function onPlayerEntered(Player) head = Player.Character.Head gui = script.Gui:Clone() gui.Parent = head gui.TextLabel.Text = Player.Name.."" -- Text wont work How do I work this gui.Enabled = true end game.Players.PlayerAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 11 Jan 2014 11:07 AM |
function onPlayerEntered(Player) repeat wait() until Player.Character head = Player.Character.Head gui = script.Gui:Clone() gui.Parent = head gui.TextLabel.Text = Player.Name gui.Enabled = true end game.Players.PlayerAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 11 Jan 2014 11:08 AM |
@OP, 1) When the "PlayerAdded" event is fired, the character isn't loaded yet, so this would error. 2) If they reset, they would lose the GUI. Use it with the "CharacterAdded" event. 3) Assuming it's a BillboardGui, you need to set the Adornee property to the part you want it adorned to, so in your case the head.
http://wiki.roblox.com/index.php/Adornee |
|
|
| Report Abuse |
|
|
|
| 11 Jan 2014 11:09 AM |
y repeat wait till character just let it register the character itself
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(steve) head = steve.Head gui = script.Gui:Clone() gui.Parent = head gui.TextLabel.Text = p.Name gui.Enabled = true end) end) |
|
|
| Report Abuse |
|
|
| |
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 11 Jan 2014 11:14 AM |
game.Players.PlayerAdded:connect(function(p) repeat wait() until p.Character head = steve.Head gui = script.Gui:Clone() gui.Parent = head gui.TextLabel.Text = p.Name gui.Enabled = true p.CharacterAdded:connect(function(steve) head = steve.Head gui = script.Gui:Clone() gui.Parent = head gui.TextLabel.Text = p.Name gui.Enabled = true end) end)
Try that. |
|
|
| Report Abuse |
|
|
|
| 11 Jan 2014 11:16 AM |
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(steve) head = steve.Head gui = script.Gui:Clone() gui.Parent = head gui.Adornee = head gui.TextLabel.Text = p.Name gui.Enabled = true end) end) |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
| |
|
| |
|