Made a play button for the player, but the gui will not show up because I set it so that characters do not automatically load in? How do I let them see the gui while at the same time keep them unloaded?
insert it manually from startergui
Tried this but does not work, it is inside startergui
local Player = game:GetService("Players").LocalPlayer
local gui = script.Parent.Selection
wait(game.Loaded)
gui.Parent = Player.PlayerGui
you are trying to wait with an event value, it only works with number values, also the script isnt put in the playergui either
If you want to achieve something like this you would want to put your ScreenGui
in Replicated First
if its the first thing you want people to see or StarterGui
if you already have a loading screen in place.
If you put your Gui
in Replicated First
then you would want to put a Local Script
in the ScreenGui
with the code:
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local ScreenGui = script.Parent
ScreenGui.Parent = localPlayer:WaitForChild("PlayerGui")
If you put your Gui
in StarterGui
then you would want to put a Local Script
in StarterPlayerScripts
with the code:
local Players = game:GetService("Players")
local StarterGui = game:GetService("StarterGui")
local localPlayer = Players.LocalPlayer
local ScreenGui = StarterGui.ScreenGui
ScreenGui.Parent = localPlayer.PlayerGui
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.