Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Gui Clones in game.StarterGui but it doesn't Appear on screen?

Hi, I made a script which gives you a Gui, and when you click it you start game and another Gui should appear, but it doesn't, I drag the Gui from Lighting to StarterGui and it appears, But when I use the script to clone it, It won't work, and I don't know why. Here's the script:

local i = script.Parent
local map = workspace.sa
local gui = script.Parent.Parent.Parent
local tele = game.Lighting.Tele
function onButtonClicked()
    local plr = game.Players.LocalPlayer
    local character = plr.Character
    character:MoveTo(map.Position)  
    tele:Clone().Parent = game.StarterGui
	script.Parent.Parent.Parent:Destroy()
    end
i.MouseButton1Down:connect(onButtonClicked)

1 answer

✓ Accepted answer

##Da Problem Your problem is that you're trying to put it in the StarterGui, which isn't what the Players see in-game. Players see a the PlayerGui, which is a Service set in the Player.


##Here's Da Fix So now to fix this, let's move it to the correct position. Here's how we'd do that:

local i = script.Parent
local map = workspace.sa
local gui = script.Parent.Parent.Parent
local tele = game.Lighting.Tele
function onButtonClicked()
    local plr = game.Players.LocalPlayer
    local character = plr.Character
    character:MoveTo(map.Position)  
    tele:Clone().Parent = plr.PlayerGui --Switched to PlayerGui
    script.Parent.Parent.Parent:Destroy()
    end
i.MouseButton1Down:connect(onButtonClicked)

So now it should work correctly.


Anyways, I hope this helped. If you have any further problems/questions, please leave a comment below :P

####-Dyler3

2 comments

0

Thanks man, Cheers!

0

No prob, glad to help :P

This discussion is preserved as it was. New answers, comments, and votes are closed.