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

How would I do something to affect all players? {NOT SOLVED}

Asked by 9 years ago

For example, in TM, when the round starts, everyone teleports to the map. I don't really know how to do that, so I thought about making a teleporter in the lobby that they have to touch to get in. But then it hit me. What if they are AFK? What if they don't even bother to touch the teleporter? Help?

0
If you're using a teleporter (triggered on touch), then anyone who is afk will obviously not touch the teleporter. You could use Guis (screengui or surfacegui) to tell the players that they need to touch the teleporter to join the round. chess123mate 5873 — 9y

3 answers

Log in to vote
1
Answered by 9 years ago

You would run through the players list and set their Character's (if any) torso CFrame to the selected point like this

local point=Vector3.new(0,0,0)
local CF=CFrame.new(point)
for _,v in next,game.Players:GetChildren() do
    if v.Character~=nil then
        v.Character.Torso.CFrame=CF
    end
end

and to check if they're afk you just have to do a loop to see if their position changes or they move recently which you can utilize the running event of humanoid for this.

0
I never wanted a script, I just wanted to know how to do it. And I prefer to use the MoveTo() method, not changing the Torso's CFrame. groovydino 2 — 9y
0
Edited answer cause i didnt read the full question nstrike159 15 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

I don't fully understand what you mean but what I would do is include a gui with a start match button which the player needs to click to start the round. This would fix the AFK as they will need to be active to click the start button.

Log in to vote
0
Answered by 9 years ago

Use a for loop because it cycles through every player until it's finished cycling through the players. It's almost instant.

Answer this question