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 » Scripters
Home Search
 

Re: Probably a VERY EASY fix, but..

Previous Thread :: Next Thread 
Despawned is not online. Despawned
Joined: 06 Apr 2013
Total Posts: 12569
15 Jun 2016 04:07 PM
Im trying to clone a gui from ServerStorage and move it to StartgerGui

Why doesn't this work?
Report Abuse
Despawned is not online. Despawned
Joined: 06 Apr 2013
Total Posts: 12569
15 Jun 2016 04:09 PM
oh forgot to paste


gui:clone()
gui.Parent = game.StarterGui
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
15 Jun 2016 04:12 PM
gui.Parent = player.PlayerGui --Must specify player
gui.Visible = true
Report Abuse
Despawned is not online. Despawned
Joined: 06 Apr 2013
Total Posts: 12569
15 Jun 2016 04:14 PM
What do you mean specify player

I get this in the output if I just do that.
attempt to index global 'player' (a nil value)
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
15 Jun 2016 04:18 PM
^ are you serious
that was obviously meant to be edited

Formerly ToxicDominator - add 17,509 posts | :(){:|:&};:
Report Abuse
Creatryx is not online. Creatryx
Joined: 28 Jan 2011
Total Posts: 450
15 Jun 2016 04:20 PM
"player" needs to be set to the player that you're moving it to. So if you wanna give it to Builderman, you'd do:
gui:clone()
gui.Parent=game.Players.Builderman.PlayerGui
Report Abuse
Despawned is not online. Despawned
Joined: 06 Apr 2013
Total Posts: 12569
15 Jun 2016 04:20 PM
I think it's clear I'm confused
Report Abuse
Despawned is not online. Despawned
Joined: 06 Apr 2013
Total Posts: 12569
15 Jun 2016 04:21 PM
Im doing a ClickDetector, so I'm trying to set it to whoever clicked, not just some random guy.

Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
15 Jun 2016 04:22 PM
it's also clear that you have no idea how to script and therefore should not be in this subforum

Formerly ToxicDominator - add 17,509 posts | :(){:|:&};:
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
15 Jun 2016 04:23 PM
local function onClick(plr)
game.ReplicatedStorate.Gui:Clone().Parent = plr.PlayerGui
end

script.Parent.ClickDetector.MouseClick:connect(plr)
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
15 Jun 2016 04:23 PM
inb4 OP comes back with an error relating to ^'s typo

Formerly ToxicDominator - add 17,509 posts | :(){:|:&};:
Report Abuse
Despawned is not online. Despawned
Joined: 06 Apr 2013
Total Posts: 12569
15 Jun 2016 04:26 PM
It works, thanks!


Report Abuse
Creatryx is not online. Creatryx
Joined: 28 Jan 2011
Total Posts: 450
15 Jun 2016 04:28 PM
Heres a script, I've added comments so you can study from it:

function onClick(plr) --This defines the function for clicking, but needs to be connected
--The first (and only) argument given to the function connected to MouseClick is the --player who clicked.

local gui=game.ServerStorage.SomeGui:clone() --Rename "SomeGui" to the name of your GUI.
--It creates a variable named "gui" and sets it to a clone of the GUI in ServerStorage

gui.Parent=plr.PlayerGui --Parents the gui to the player
end
script.Parent.MouseClick:connect(onClick) --connect the MouseClick event to the onClick --function


Make sure it's inside of the ClickDetector.
Report Abuse
Despawned is not online. Despawned
Joined: 06 Apr 2013
Total Posts: 12569
15 Jun 2016 06:26 PM
I have to double click in order to have the gui pop up, any ideas why?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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