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
|
  |
| 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 |
|
|
|
| 15 Jun 2016 04:12 PM |
gui.Parent = player.PlayerGui --Must specify player gui.Visible = true |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 06 Apr 2013 |
| Total Posts: 12569 |
|
|
| 15 Jun 2016 04:20 PM |
I think it's clear I'm confused
|
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 06 Apr 2013 |
| Total Posts: 12569 |
|
| |
|
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
|
  |
| 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 |
|
|