admin = {"Player1"}
game.Players.PlayerAdded:connect(function(nP)
for _,v in pairs(admin) do
if nP.Name == v then
nP.Chatted:connect(function(msg)
if msg == ">Load Caves" then
wait(1)
x = game.Lighting.Caves:Clone()
wait(0.1)
x.Parent = game.Workspace
y = game.Lighting.MapLoadedGui:Clone()
y.Parent = Game.StarterGui
game.StarterGui.MapLoadedGui.Frame.TextBox.Text = "Map Loaded: Caves"
wait(3)
y:Destroy()
end
end)
end
end
end)
I'm making a script that loads a map when an admin says ">Load Caves". The map part is working perfectly. But the gui only shows up when I reset or respawn or refresh myself. How do I make it so the gui shows up as soon as it's put in "game.StarterGui"?

1 comment
When I refresh, the gui comes up just fine, trying to find a way for it to come up without refreshing. http://prntscr.com/eqjp8p