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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Gui script

Previous Thread :: Next Thread 
obedientyankees96 is not online. obedientyankees96
Joined: 17 Jul 2010
Total Posts: 2023
07 Aug 2011 04:19 PM
This should move a gui from one person to the next when the button "Enter" is clicked. It keeps it on the first persons screen though and there isn't an output. Help please!

local num = 1

script.Parent.Enter.MouseButton1Click:connect(function()
num = num + 1
local a=game.Players:GetChildren()
if num < #a then
script.Parent.Parent = a[num].PlayerGui
elseif num > #a then
num = 1
script.Parent.Parent = a[num].PlayerGui
end print(num) end
)
Report Abuse
61352151511 is not online. 61352151511
Joined: 30 Nov 2009
Total Posts: 8094
07 Aug 2011 04:20 PM
What will happen is that the script will reset (I believe) when the parent is changed. Causing num to stay at 1. Try a NumberValue inside the gui.

~ Mitch ~
Report Abuse
obedientyankees96 is not online. obedientyankees96
Joined: 17 Jul 2010
Total Posts: 2023
07 Aug 2011 04:22 PM
So like when the gui is moved to you, the number goes back to 1, bringing it to me?
Report Abuse
61352151511 is not online. 61352151511
Joined: 30 Nov 2009
Total Posts: 8094
07 Aug 2011 04:25 PM
Here's what I would do.

script.Parent.Enter.MouseButton1Click:connect(function()
local a = game.Players:GetChildren()
if script.Parent.Current.Value <= #a then
script.Parent.Current.Value = script.Parent.Current.Value + 1
script.Parent.Parent = a[script.Parent.Current.Value].PlayerGui
else
script.Parent.Current.Value = 1
script.Parent.Parent = a[script.Parent.Current.Value = 1].PlayerGui
end
end)

~ Mitch ~
Report Abuse
obedientyankees96 is not online. obedientyankees96
Joined: 17 Jul 2010
Total Posts: 2023
07 Aug 2011 04:56 PM
It still doesn't work.
Report Abuse
obedientyankees96 is not online. obedientyankees96
Joined: 17 Jul 2010
Total Posts: 2023
07 Aug 2011 05:39 PM
Bump
Report Abuse
obedientyankees96 is not online. obedientyankees96
Joined: 17 Jul 2010
Total Posts: 2023
07 Aug 2011 06:54 PM
Bump again.. Help pl0x..
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