So I have an admin panel for my game and i have a button. That is meant to freeze the player that the person selected (For Example The Username is typed out In a textbox and then you can freeze the player.) but when I click The "freeze player Button" it does not work I've made the freeze button Filtering enabled so its not that here is part of the script that is meant to do the freeze player event.
game.ReplicatedStorage.Fe.Freeze.OnServerEvent:Connect(function(plr, player) --Checks if the Freeze Remote Event Is Triggered
for i, v in pairs (game.Workspace:GetChildren()) do
if v.Name == player then
player.Humanoid.WalkSpeed = 0
print(player)--Printing the player name
end
end
end)
I would be very Thankful If Anyone would help me with this issue Thanks! Sorry for my bad English.

2 comments
consider that if :FindFIrstChild Returns nil,then the script will break, other wise good job
oh yeah that's true, fixed it