Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 10 Mar 2014 06:54 PM |
| This isnt a problem that I'm trying to create something before it loads, but that it either isn't loading or something is setting its parent to nil. I checked ALL my scripts and nothing is destroying the player's playergui. Any ideas? |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 10 Mar 2014 07:00 PM |
I opened up two players in a server on studio. The result was that on the server window, both playerguis exist. But on the individual player windows, only their playergui existed. This is the error message:
19:59:02.854 - PlayerGui is not a valid member of Player 19:59:02.854 - Script 'Players.Player2.PlayerGui.Status.Frame.TextBox.LocalScript', Line 10 19:59:02.858 - stack end |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2014 07:01 PM |
| Its a big problem for me too! YOu just basically need the script to figure out when everything is loaded in, because roblox doesnt have any way to detect that (atleast in studio, I dont do much outside of studio) |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 10 Mar 2014 07:12 PM |
| Sorry, I'm confused by what you said... |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2014 07:15 PM |
| Everything has to load in when the game starts. PlayerGui does not exist at the time the script is starting, and therefor you need a way to check when everything is loaded in |
|
|
| Report Abuse |
|
|
| |
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 10 Mar 2014 07:21 PM |
I can post everything, it isn't too long.
player = script.Parent.Parent.Parent.Parent.Parent box = script.Parent mouse = player:GetMouse()
mouse.KeyUp:connect(function(key) if key:byte() == 47 then box:CaptureFocus() elseif key:byte() == 13 then for _,plr in pairs(game.Players:GetPlayers()) do for _,label in pairs(plr.PlayerGui.Status:GetChildren()) do if label.ClassName == "TextLabel" then label.Position = UDim2.new(label.Position.X.Scale,10,label.Position.Y.Scale + 0.035,0) if label.Position.Y.Scale >= 0.25 then label:Destroy() end end end new = Instance.new("TextLabel",plr.PlayerGui.Status) new.BackgroundTransparency = 1 new.Position = UDim2.new(0,10,.05,0) new.Size = UDim2.new(.2,0,.03,0) new.Text = "SourceSansBold" new.FontSize = "Size14" new.Text = ""..player.Name..":"..box.Text.."" new.TextColor3 = player.TeamColor.Color new.TextTransparency = .25 new.TextXAlignment = "Left" end box.Text = 'To chat, click here or press "/" key' end end) |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2014 07:22 PM |
Try adding:
repeat Wait() until Player:FindFirstChild("PlayerGui")
Or maybe just "Wait()" at the top of the script. |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 10 Mar 2014 07:24 PM |
| Sure. That shouldn't be a problem since its a keyup activated event but I'll try it |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
| |
|
|
| 10 Mar 2014 07:26 PM |
Try:
for _,label in pairs(plr:WaitForChild("PlayerGui").Status:GetChildren()) do
|
|
|
| Report Abuse |
|
|
| |
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 10 Mar 2014 07:35 PM |
| Nope. I'm pretty sure it is not a loading problem. The playergui IS THERE, but it does not show that it is there for other players. |
|
|
| Report Abuse |
|
|