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: GUI appearing TWICE in PlayerGui ...

Previous Thread :: Next Thread 
Izzik is not online. Izzik
Joined: 28 Jan 2010
Total Posts: 45
28 Nov 2013 01:08 AM

When in solo mode, this script works fine. On server, things get a little wierd for some reason...

The problem is that the GUI is being created *twice* in the PlayerGui...as you can see, the GUI gets given a parent only once...what on earth is making it double up when on a server?

The below code is in a HopperBin being used as a tool. Thanks for any help.

-----------

ison = false
local Tool = script.Parent

function makegui(main)

main = Instance.new("ScreenGui")
main.Name="CloneMain"


return main end

function onSelected(mouse)

gui = makegui(var)
gui.Parent=Tool.Parent.Parent.PlayerGui
ison = true

end

function onDeselected(mouse)


if ison==true then

gui:remove()
ison = false

end

end

Tool.Selected:connect(onSelected)
Tool.Deselected:connect(onDeselected)

----
Report Abuse
izzatnasruna is not online. izzatnasruna
Joined: 09 Jun 2009
Total Posts: 1927
28 Nov 2013 02:42 AM
Well you see, the difference between Solo and Server is,

Solo:
Every script will be as if it is a Local Script

Server:
Script is Script
Local Script is Local Script
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
28 Nov 2013 03:20 AM
Basically the above person is saying
Put it in a localscript
Report Abuse
izzatnasruna is not online. izzatnasruna
Joined: 09 Jun 2009
Total Posts: 1927
28 Nov 2013 03:22 AM
Thank you for simplicizing it. :)
Report Abuse
Izzik is not online. Izzik
Joined: 28 Jan 2010
Total Posts: 45
28 Nov 2013 11:41 AM
Brilliant! This did the trick, thanks both.
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