I can't locate "Humanoid"

For some reason I can’t find a way to get the Humanoid. I’m using a normal script so I know I can’t use game.Players.LocalPlayer or something like that. I don’t want to use a touched event because I’m making a sword so it will loop. Any ideas how to achieve this? I searched a lot yet I couldn’t seem to find any reasonable answers.
Thanks for reading. :slight_smile:

There’s no fixed way of getting the humanoid in a normal script, unlike local scripts, if you wanna get the humanoid from a specific person do

game.Workspace.THEIR USERNAME.Humanoid

So there’s no way to get it like:
local Humanoid = hit.Parent:FindFirstChild(“Humanoid”)

Oh i kinda missread that since you mentioned that you don’t wanna use touched events, that would work in a normal script

Is there anyway to get the player or character on a normal script?

I still don’t understand what you need since this is really vage
If you wanna get the character from the player use player.Character
if you wanna get the player from the character use GetPlayerFromCharacter

Since global scripts are server side they arent attached to any player so theres no real way of getting a player from nothing (aka LocalPlayer)

1 Like

Oh because I thought if I could get the player I would be able to get the humanoid. I’m just trying to make a sword.

Yeah just use player.Character
Since the Character contains the Humanoid you can add :FindFirstChild(“Humanoid”) at the end

I’m sorry I still don’t understand how I get the player, my bad.

Ill try another solution, since you were using a loop you might be able to use
local var = BasePart:GetTouchingParts
Since it throws a table with a list of the parts touching the BasePart
then you can use var[1].Parent:FindFirstChild(“Humanoid”) to get the humanoid, that way you can keep using the loop and get the humanoid at the same time without touch events

(My laptop will run out of batery soon so I might stop answering randomly)

1 Like