Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

GUI not being cloned?

Asked by 9 years ago

Hello, I am making a Term for a group. So there is a model Called Term (Which is in Workspace). Inside there is a part called as Beam and inside the beam there is a script called as Script. So inside the script there is an GUI. The GUI tells how much time is left or who won and all. I created a separate local script and added this command.

local player = game.Players.LocalPlayer.PlayerGui
gui = script.Parent.Script.CaptureGUI:Clone()
gui.Parent = player

But sadly, It does not copy it. There is a no error in the output. Can someone tell me the problem? The name of the GUI is correct. If you could can answer as fast as possible it would help me out :)

2 answers

Log in to vote
1
Answered by 9 years ago

script.Parent.Script.CaptureGUI:Clone().Parent = game.Players.LocalPlayer.Playergui

0
Not working :/ PlayingOBC 70 — 9y
Ad
Log in to vote
0
Answered by
rexbit 707 Moderation Voter
9 years ago

It could be that PlayerGui is not loading in time, the occupation of :WaitForChild A redundant method, could help.

local player = game.Players.LocalPlayer:WaitForChild("PlayerGui")
gui = script.Parent.Script.CaptureGUI:Clone()
gui.Parent = player

If this doesn't seem to work, try rechecking your code syntax.

0
From what PlayingOBC described it seems the script is a descendant of PlayerGui, so waiting for that is unlikely to cause a difference. NullSenseStudio 342 — 9y
0
Its not working PlayingOBC 70 — 9y
0
I got an output: 15:50:20.051 - Workspace.Raid System.RaidSystemV1.Script:1: attempt to index field 'LocalPlayer' (a nil value) PlayingOBC 70 — 9y
0
its super late but u probably wrote local player togetehr xd Paintertable 171 — 7y

Answer this question