Ahoy human beings,
I am still kind of confused on how to get a player's humanoid without a touch event.
If you don't understand what I am talking about, please feel free to ask questions.
Thanks everyone!
Ahoy human beings,
I am still kind of confused on how to get a player's humanoid without a touch event.
If you don't understand what I am talking about, please feel free to ask questions.
Thanks everyone!
I will show you how to reference it in a local script, and in a server script:
Server Script
game.Players.PlayerAdded:Connect(function(player) -- This gets the player
player.CharacterAdded:Connect(function(character) -- We already have the player, so this detects when the player's character is added into the game
-- The character is a child inside of the player
local humanoid = character.Humanoid
end)
end)
Local Script
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid
If I helped please accept this answer!
Thanks for the local script one, but I don't understand the serverscript one.
Oh nevermind I get it now. Thanks!
Sorry I made a mistake, it should be fixed now, if you need any more help please ask! :)
This discussion is preserved as it was. New answers, comments, and votes are closed.
9 comments
ok I don't understand
So what I'm talking about is, how to reference a player's humanoid. For example, if you would make a normal veriable, you would say game.Workspace.Part or whatever, but it doesn't work the same way with a player's humanoid.
ok then use Player.Character or you can use for i,v in pairs(game.Players:GetPlayers()) do to get all of players
it completely depends on what you're doing.
When I try it out, the output keeps printing attempt to index nil with 'Character'
You cannot use a ServerScript and LocalPlayer in conjunction.
https://cp.hexit.cc
https://client.hexit.cc
https://client.hexit.cc/login