generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Local scripts...

Previous Thread :: Next Thread 
BEART12 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image