Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Player doesn't spawn until Gui is destroyed?

Asked by 10 years ago

So i have a intro GUI. And for the GUI to close you must press a TextButton that says "PLAY". I want to make it so the player will not spawn until they press that button.

This is the script that plays the intro GUI when a player joins. The commented part is as far as i got.

game.Players.PlayerAdded:connect(function(player)
   -- player.Character

    script.LocalScript:clone().Parent = player.CharacterAdded:wait()
    c = game.ServerStorage.hi:Clone()
    c.Parent = player.PlayerGui
end)

And here is the localScript for the button.

main = script.Parent
totalMain = main.Parent
cam = game.Workspace.CurrentCamera
---------------------------

main.MouseButton1Click:connect(function() -- Triggers when player clicks the button
    totalMain:Destroy()
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
--game.Workspace.CurrentCamera.CameraType = "Custom"
--cam.CoordinateFrame=CFrame.new(0,-1,-1)
player.LocalScript:Destroy()
end)

Answer this question