Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TeleportScript (TeleportButton)
- LocalScript (TeleportFrame)
- LocalScript2 (TeleportButton inside of teleportframe)
- Teleport (RS)
- TeleportScript:
- local Teleport = script.Parent.Parent.TeleportButton
- local frame = script.Parent.TeleportFrame
- Teleport.MouseButton1Click:Connect(function()
- frame.Visible = true
- end)
- LocalScript:
- game.ReplicatedStorage.Teleport.OnClientEvent:Connect(function(plr, name)
- plr.Character.HumanoidRootPart.CFrame = game.Players:FindFirstChild(name).Character.Head
- end)
- LocalScript2:
- script.Parent.MouseButton1Click:Connect(function()
- if game.Players:FindFirstChild(script.Parent.Parent.Username.Text) then
- game.ReplicatedStorage.Teleport:FireServer(script.Parent.Parent.Username.Text)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement