So i'm trying to reference the Humanoid so I can damage the player upon touching something, but it doesn't work. Here is how I tried to reference the Humanoid
local humanoid = game.Players.LocalPlayer:FindFirstChild("Humanoid")
I also tried local humanoid = game.Players.LocalPlayer:WaitForChild("Humanoid")
but didnt work
Humanoid is a child of Character. So you will need to add another hierarchy in order to get the humanoid. Also I recommend putting CharacterAdded in case the character isn't there.
local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid")