This will select a random player but it doesn't seem to be finding a Humanoid. The purpose of the script is to force equip a tool to a random player and it's not working and I'm not too sure why?
local players = game.Players:GetChildren() local randomplayer = players[math.random(1, #players)] randomplayer:WaitForChild("Humanoid") randomplayer.Humanoid:EquipTool(game.ServerStorage.HotPotato)
The Humanoid
object is inside of the Player's Character, not inside the Player(:
Look for the humanoid inside of the Player's Character!
local players = game.Players:GetChildren() local randomplayer = players[math.random(1, #players)] --Search in character randomplayer.Character:WaitForChild("Humanoid") randomplayer.Character.Humanoid:EquipTool(game.ServerStorage.HotPotato)
The humanoid is inside the player's 3d model in Workspace, or it's Character.
cal players = game.Players:GetChildren() local randomplayer = players[math.random(1, #players)] randomplayer.Character:WaitForChild("Humanoid") randomplayer.Character.Humanoid:EquipTool(game.ServerStorage.HotPotato)
Hope this helped!