Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how would i anchor all players at the same time?

local repStorage = game:GetService("ReplicatedStorage")
local RemoteFolder = repStorage.RemoteEvents
local MusicRemote = RemoteFolder.MusicEvent
local TextValue = repStorage.TextValue
local SoundFolder = game.Workspace.SoundEffects
local StartMeetingEvent = RemoteFolder.StartMeetingEvent

local function PlayMusic()
	SoundFolder.Music:Play()
end

local function StartMeeting(plr)
	TextValue.Value = "Welcome everyone"
	wait(2)
	TextValue.Value = "Glad you could all be here"
	wait(2)
	TextValue.Value = "Thanks for taking a seat"
	plr.Character.HumanoidRootPart.Anchored = true -- here where the players should be anchored
	
end

MusicRemote.OnServerEvent:Connect(PlayMusic)
StartMeetingEvent.OnServerEvent:Connect(StartMeeting)

its called via a button in a localplayer

3 answers

✓ Accepted answer

Make a for loop, that loops through every player and makes them anchored.

wait(2)
for i, player in pairs(game.Players:GetPlayers()) do
	player.Character.HumanoidRootPart.Anchored = true	
end

--- your code

Sorry for lack of elaborate answer

local workspace = game.Workspace:GetChildren() workspace.anchored = true

for _, player at pairs (game.Players:GetPlayers()) do -- Taking all players in pairs
	character = player.Character or player.CharacterAdded:Wait() -- Getting Character

	character.HumanoidRootPart.Anchored = true -- Set HumanoidRootPart Anchor to true
end

Say if you have any errors

This discussion is preserved as it was. New answers, comments, and votes are closed.