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 in ReplicatedStorage works fine in Studio, not game

Previous Thread :: Next Thread 
LuckyAura is online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
08 Nov 2014 11:34 PM
I have these tools that have a script in them which grabs the GUI from ReplicatedStorage, which works fine. The GUI shows up. But some of the things in the GUI don't work, and others do. It's driving me crazy. Can someone help me? Is there another place I can store GUI's where they will work if a copy is made??

Here's the script that calls for the GUI from ReplicatedStorage:

function LoadGui()
repeat wait() until game.Players.LocalPlayer.Character
if not gui then
gui = game.ReplicatedStorage.YoungBenGUI:Clone()
gui.Parent = game.Players.LocalPlayer.PlayerGui
print("Gui placed into player.")
else return end
end

function UnloadGui()
gui:Destroy()
gui=nil
end

script.Parent.Equipped:connect(function()
LoadGui()
end)

script.Parent.Unequipped:connect(function()
UnloadGui()
end)
Report Abuse
demon8845 is not online. demon8845
Joined: 07 Feb 2010
Total Posts: 335
08 Nov 2014 11:35 PM
localplayer
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
08 Nov 2014 11:37 PM
If there are things in the gui that don't work then it's not the tools we need to be seeing. Find out what isn't working and post those scripts instead.
Report Abuse
LuckyAura is online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
09 Nov 2014 12:30 AM
@xiaoxiao181 By that I meant certain things don't work when the tool is taking the GUI from ReplicatedStorage. But when I use it inside of Studio, or in StarterGUI, everything works.
Report Abuse
Madified is not online. Madified
Joined: 19 Apr 2011
Total Posts: 5292
09 Nov 2014 12:44 AM
Is it in a local script?
Report Abuse
LuckyAura is online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
09 Nov 2014 01:05 AM
Yes. I tried changing it to a script but then it doesn't get the GUI from ReplicatedStorage.
Report Abuse
LuckyAura is online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
09 Nov 2014 11:00 AM
Bump.
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
09 Nov 2014 11:13 AM
Instead of having the gui in ReplicatedStorage, just put it into the tool. It won't show up in the Tool.
Report Abuse
LuckyAura is online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
09 Nov 2014 04:24 PM
Bumping again.. :/
Report Abuse
LuckyAura is online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
09 Nov 2014 07:49 PM
These are two of the scripts inside of the GUI if it helps:

page = script.Parent.Page
function close()
script.Parent.C1.Visible = false
end

function onChanged()
if script.Parent['C'..page.Value] then
close()
script.Parent['C'..page.Value].Visible = true
else return
end end

page.Changed:connect(onChanged)


and


for i,c in pairs(script.Parent:GetChildren()) do
if c:IsA("ImageButton") then
c.MouseButton1Click:connect(function()
p = script.Parent.Parent.Parent.Parent.Parent
wait(0.25)
for _,v in pairs(p.Character:GetChildren()) do
if v:IsA("Tool") and v.Name~='YoungBensOmnitrix' then
v:Destroy()
end end
for _,v in pairs(game.ServerStorage.GameTools[c.Suit.Tool.Value]:GetChildren()) do
if v:IsA("HopperBin") or v:IsA("Tool") then
if p:FindFirstChild'Backpack' then
v:clone().Parent = p.Backpack
end end end end) end end
Report Abuse
LuckyAura is online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
09 Nov 2014 10:56 PM
Someone please help this is bothering me :C
Report Abuse
LuckyAura is online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
10 Nov 2014 12:45 PM
Bump..
Report Abuse
LuckyAura is online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
10 Nov 2014 02:09 PM
Please someone I really need help with this..
Report Abuse
LuckyAura is online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
10 Nov 2014 04:27 PM
:(
Report Abuse
LuckyAura is online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
10 Nov 2014 05:42 PM
Anyone?...
Report Abuse
LuckyAura is online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
10 Nov 2014 06:44 PM
Should I just make a new topic?.. :/
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