|
| 30 Jun 2015 04:25 AM |
I'm trying to somehow get a GUI visible after purchasing something that'll either clone it or make it visible, so far I've tried these.
game.Lighting.NameHide:clone().Parent.StarterGUI
game.StarterGUI.NameHide.Click.Visible = true
game:GetService("StarterGUI").NameHide.Click.Visible = true
What exactly am I doing wrong? |
|
|
| Report Abuse |
|
|
Sevrick
|
  |
| Joined: 22 Oct 2013 |
| Total Posts: 3846 |
|
| |
|
|
| 30 Jun 2015 04:29 AM |
try:
clone = game.Lighting.NameHide:clone() clone.Parent = (player).StarterGui clone.Visible = true
|
|
|
| Report Abuse |
|
|
Sevrick
|
  |
| Joined: 22 Oct 2013 |
| Total Posts: 3846 |
|
|
| 30 Jun 2015 04:30 AM |
| You mean (player):WaitForChild("PlayerGui") |
|
|
| Report Abuse |
|
|
Sevrick
|
  |
| Joined: 22 Oct 2013 |
| Total Posts: 3846 |
|
|
| 30 Jun 2015 04:30 AM |
| 'GUI' is in capitals, the name should be 'StarterGui'. |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2015 04:38 AM |
| I keep getting the error of "StarterGui isn't a valid member of Player" |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2015 04:59 AM |
| Can you show us the full script? |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2015 05:01 AM |
--In a local script.
script.Parent.MouseButton1Down:connect(function()
local player = game.Players.LocalPlayer
local stats = player:FindFirstChild('leaderstats') if not stats then return end local Cash = stats:FindFirstChild('Cash') if not Cash then return end if Cash.Value >= 100 then Cash.Value = Cash.Value - 100 clone1 = game.Lighting.NameHide:clone() clone1.Parent = (player).StarterGui clone1.Visible = true script.Parent.Parent.bought:Play()
script.Parent.Parent.Parent.purchased.Visible = true wait(1.5) script.Parent.Parent.Parent.purchased.Visible = false
else if Cash.Value <= 100 then script.Parent.Parent.error:Play() end end end) |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2015 05:13 AM |
Funny.
The solution is:
NOT "StarterGui", you have to copy your Gui and put it into the player's "PlayerGui" ------------------------------------------------------------------- if Cash.Value >= 100 then Cash.Value = Cash.Value - 100 clone1 = game:GetService("Lighting").NameHide:clone() clone1.Parent = player.PlayerGui clone1.Visible = true script.Parent.Parent.bought:Play() ------------------------------------------------------------------- And please, don't use "Lighting" to store things. Use ReplicatedStorage instead. |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2015 05:27 AM |
I know @ the ReplicatedStorage, it's just a habit.
Also, the script works, however I'm trying to make it stay in the PlayerGui Permanently, how would I reflect the script to change that?
|
|
|
| Report Abuse |
|
|