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)
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.
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