of     1   

TheNewScripter
#44624189Saturday, March 26, 2011 5:30 PM GMT

It has no output, but yet it won't insert the BillboardGui into the character's head. Players=Game:service("Players") local img=script.Picture:Clone() Allowed={"TheNewScripter","Player"}; function Check(name) for _,allow in pairs(Allowed) do if name:lower()==allow:lower() then return true end end return false end function onPlayerRespawn(prop,play) if prop=="Character" and play.Character then local head; repeat wait() until play.Character:findFirstChild("Head") head=play.Character.Head local bg=Instance.new("BillboardGui",head) bg.Adornee=head bg.Name="Display" bg.StudsOffset=Vector3.new(0,2,0) local picture=img:Clone() picture.Parent=bg end end function onPlayerEntered(new) local checkIfAllowed=Check(new.Name) if checkIfAllowed then new.Changed:connect(function(property) onPlayerRespawn(prop,new) end) end end Players.PlayerAdded:connect(onPlayerEntered)
shouksta
#44624252Saturday, March 26, 2011 5:30 PM GMT

You didn't define the parent of bg
Robert00001
#44624284Saturday, March 26, 2011 5:31 PM GMT

He did
TheNewScripter
#44624389Saturday, March 26, 2011 5:32 PM GMT

@shouk Instance.new(class, parent=nil) Parent is nil unless you set it something manually.
shouksta
#44624472Saturday, March 26, 2011 5:33 PM GMT

My bad was reading to fast.
B3tturTh3nU
#44624550Saturday, March 26, 2011 5:34 PM GMT

Perhaps it would appear more visible if you specified a size for the gui?
TheNewScripter
#44624839Saturday, March 26, 2011 5:38 PM GMT

No, the GUI won't even insert into the players head. It just doesn't even inesrt =/ P.S. Long time no see B3ttur :3
oysi93
#44624988Saturday, March 26, 2011 5:40 PM GMT

Add this to the end: for _, Player in pairs(Game.Players:GetPlayers()) do onPlayerEntered(Player) end
Phascinate
#44625073Saturday, March 26, 2011 5:41 PM GMT

If it doesn't even put the GUI into the head, there must be something wrong with the function.
oysi93
#44625156Saturday, March 26, 2011 5:43 PM GMT

Btw, use "Player.CharacterAdded:connect(function(Character) end)" instead.
B3tturTh3nU
#44625209Saturday, March 26, 2011 5:43 PM GMT

Are you testing this in "solo test" or whatever it's called? If so, scripts often don't load until after your player 'connects'. It's usually better to use the 'server test', as it gives your scripts a chance to load before anyone joins. Also, the player.Changed event doesn't look too reliable the way you're using it. I personally recommend changing that to "CharacterAdded". new.CharacterAdded:connect(onPlayerRespawn) Of course, that returns the character, not the player. So, you'll have to modify your code slightly.
TheNewScripter
#44626189Saturday, March 26, 2011 5:57 PM GMT

I actually tested in a real game. Saved and played it. Its ok, I just remade it using a while loop.

    of     1