local Hitboxes = {'Head', 'Torso', 'LeftUpperArm', 'RightUpperArm', 'LeftLowerLeg', 'RightLowerLeg'}
local hitbox = Hitboxes[math.random(1,#Hitboxes)]
print(hitbox) -- prints out hitbox
print(game.Players.LocalPlayer:FindFirstChild(hitbox)) -- prints out nil
COMMUNITY QUESTION
FindFirstChild Hitbox not working?
1 answer
It is printing out nil because it is searching for a hitbox inside of the player, not the character. Change it to this:
local Hitboxes = {'Head', 'Torso', 'LeftUpperArm', 'RightUpperArm', 'LeftLowerLeg', 'RightLowerLeg'}
local hitbox = Hitboxes[math.random(1,#Hitboxes)]
print(hitbox) --prints out a hitbox
print(game.Players.LocalPlayer.Character:FindFirstChild(hitbox)) -- also prints out a hitbox
This discussion is preserved as it was. New answers, comments, and votes are closed.
