I'm trying to make other players stop and the player who pressed "F" still be able to walk
But it makes everyone able to walk
Can anyone help me?
local plrs = game.Players:GetPlayers()
local p = game.Players.LocalPlayer
local char = p.Character
if not p.Character then
repeat wait() until p.Character
end
local human = char.Humanoid
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(inputObject)
if inputObject.KeyCode==Enum.KeyCode.F then
game:GetService("ReplicatedStorage").Purple:FireServer()
for i, v in pairs(plrs) do
v.Character.Humanoid.WalkSpeed = 0
if v.Name == p.Name then
v.Character.Humanoid.WalkSpeed = 16
end
end
end
end)
UIS.InputEnded:Connect(function(inputObject)
if inputObject.KeyCode==Enum.KeyCode.F then
wait(4)
game:GetService("ReplicatedStorage").Normal:FireServer()
for i, v in pairs(plrs) do
v.Character.Humanoid.WalkSpeed = 16
end
end
end)
The ambient part works though

3 comments
How do I make it anchor everyone's humanoid root parts expect the player?
How do I make it anchor everyone's humanoid root parts except the player?
@TheNINJA152 I edited my post to answer your question. Tell me if there are any problems.