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: Help?

Previous Thread :: Next Thread 
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
13 Nov 2011 02:38 PM
local brick = script.Parent
Game.Players.PlayerAdded:connect(function(p)
    p.CharacterAdded:connect(function(c)
        repeat wait() until c.Torso
        coroutine.resume(coroutine.create(function()
            while wait() do
                if (brick.Position-c.Torso.Position).magnitude <= 10 then --Change 10 to whatever you want
                    script.GUI:Clone().Parent = p.PlayerGui
                elseif p.PlayerGui.GUI ~= nil then
                    p.PlayerGui.GUI:Remove()
                end
            end
        end))
    end)
end)


Output:
GUI is not a valid member of PlayerGui

I don't know how to fix it.
Report Abuse
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
13 Nov 2011 02:41 PM
Bump
Report Abuse
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
13 Nov 2011 03:14 PM
Bump
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
13 Nov 2011 03:16 PM
Put GUI in the PlayerGui. Duhhhh.
Report Abuse
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
13 Nov 2011 03:21 PM
if (brick.Position-c.Torso.Position).magnitude <= 10 then --Change 10 to whatever you want
script.GUI:Clone().Parent = p.PlayerGui
elseif p.PlayerGui.GUI ~= nil then
p.PlayerGui.GUI:Remove()
end

It does....
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
13 Nov 2011 03:23 PM
elseif p.PlayerGui:FindFirstChild("GUI") then
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