BEART12
|
  |
| Joined: 22 Oct 2008 |
| Total Posts: 3190 |
|
|
| 04 Jan 2014 07:53 PM |
What do they fail to access out of PlayerGui, as im trying to debug. Thansk. |
|
|
| Report Abuse |
|
|
xSIXx
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 9202 |
|
|
| 04 Jan 2014 08:02 PM |
you have to wait until the playergui is in the player
game.Players.LocalPlayer:WaitForChild("PlayerGui") -- will halt the script until the playergui is found
and yes, you have to do that for every single GUI in the playergui as well, including decendents of the screen gui.
i would just add a "wait(5)" in the script to make sure everything is present. |
|
|
| Report Abuse |
|
|
BEART12
|
  |
| Joined: 22 Oct 2008 |
| Total Posts: 3190 |
|
|
| 05 Jan 2014 10:16 AM |
repeat wait() until Player.Character repeat wait() until Player:WaitForChild("PlayerGui") print("Player has spawned!")
I have done this and it is still the same outcome.
|
|
|
| Report Abuse |
|
|
duckwit
|
  |
| Joined: 08 Aug 2008 |
| Total Posts: 1310 |
|
|
| 05 Jan 2014 10:20 AM |
Could you phrase your question a little more clearly, Beart12? I don't understand what you're having a problem with enough to suggest a workaround. What do you mean by "access out of PlayerGui" - The script(s) cannot access something that is outside of the PlayerGui, or that they cannot access something inside of it? Where are the scripts being run from, are they in the PlayerGui, Backpack, Character Model, or somewhere else? You could also try posting your scripts. |
|
|
| Report Abuse |
|
|
BEART12
|
  |
| Joined: 22 Oct 2008 |
| Total Posts: 3190 |
|
|
| 05 Jan 2014 10:23 AM |
Sorry. I was asking if a local script fails to access anything out of playerGui. |
|
|
| Report Abuse |
|
|
duckwit
|
  |
| Joined: 08 Aug 2008 |
| Total Posts: 1310 |
|
|
| 05 Jan 2014 10:27 AM |
There should not be a problem with accessing things that are outside of the PlayerGui, no. If you are having trouble accessing something, it's not because you are using a LocalScript - you will have to show us the script if you want any further diagnosis of the problem. |
|
|
| Report Abuse |
|
|
BEART12
|
  |
| Joined: 22 Oct 2008 |
| Total Posts: 3190 |
|
|
| 05 Jan 2014 10:39 AM |
while true do wait() local interact_dis = 5 local chosen = nil for _, v in pairs(Game.Workspace:GetChildren()) do if string.match(v.Name, "Buyable") then local a = Char.Torso.Position if (v.Part.Position - a).magnitude < interact_dis then chosen = v end end end script.interact.Value = chosen print(chosen)
if chosen == nil then Player.PlayerGui.GameGui.ShowBuyInfo.Visible = false end if chosen ~= nil then Player.PlayerGui.GameGui.ShowBuyInfo.Visible = true if script.interact.Value.Name == "Olympia, Buyable" then Player.PlayerGui.GameGui.ShowBuyInfo.Text = "Press [F] Weapon[500],Ammo[250],Upgraded Ammo[4500]!"
end end ------------ end
|
|
|
| Report Abuse |
|
|