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

How to I make all players teleport to a brick?

Asked by 11 years ago

What's a script where it chooses all players in the game, and teleports them to a block?

2 answers

Log in to vote
0
Answered by 11 years ago

If you want it as a tool use this script:

01local debounce = false --Just in case
02local m = Instance.new("Message")
03m.Parent = game.Players.LocalPlayer
04Tool = script.Parent
05Player = game.Players.LocalPlayer
06 
07function onButton1Down(mouse)
08Player.Character.Torso.CFrame = CFrame.new(game.Workspace.Spawn's Name.Position) + Vector3.new(0,3,0)
09end
10 
11function onSelected(mouse)
12    mouse.Button1Down:connect(function() onButton1Down(mouse) end)
13end
14 
15function onDeselect(mouse)
16end
17 
18script.Parent.Selected:connect(onSelected)
19script.Parent.Deselected:connect(onDeselect)

Local script in Hopper

Ad
Log in to vote
0
Answered by
KAAK82 16
11 years ago

the Following goes in a Part's LocalScript;

1plr = game.Players.LocalPlayer
2char = plr.Character
3brick = game.Workspace.Spawn -- change Spawn to ur Brick
4 
5function onTouch()
6    char:MoveTo(brick.Position)
7end
8 
9script.Parent.Touched(onTouch)

see? no big long lines... also, trust me... I have an automatic teleporter that teleports players every round to their Spawns in my other account... so this should work... and u don't really need Vector3.new() cos only some people use it to Rotate Players... Hope I helped... Also, check me out on Roblox and check my Free Models... I made myself, there's also a Random Teleporter if u click a Button (Gui Button)

Answer this question