game.Players.PlayerAdded:connect(function(nP) -- connect event to anonymous function nP.CharacterAdded:connect(function(nC) -- connect event to anonymous function sg = Instance.new("ScreenGui", nP.PlayerGui) -- create the screengui sg.Name = "Welcome" -- set its name fr = Instance.new("Frame", sg) -- create the frame inside the ScreenGui fr.Size = UDim2.new(0, 150, 0, 30) -- set its size fr.Position = UDim2.new(0, 0, 0.5, -15) -- center the frame fr.Style = "RobloxRound" tb = Instance.new("TextButton", fr) -- create a textbutton, put it in frame tb.Size = UDim2.new(1, 0, 1, 0) tb.Style = "RobloxButtonDefault" tb.TextColor3 = Color3.new(1, 1, 1) tb.Text = "Join Game" tb.MouseButton1Click:connect(function(Plr) local Humanoid = clicker and clicker.Parent and clicker.Parent:FindFirstChild("Humanoid") if Humanoid then Humanoid.Torso.CFrame = CFrame.new (Vector3.new(-683, 43.201, -81)) end end) end) end)
This is a script that teleports a player to certain place when he clicks the Gui