Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to get the character and humanoid of a player using a server script?

im stupid and i don't know how to do that, i also don't even know if it works soooo

If anyone knows, please answer, I'd appreciate it a lot

1 answer

✓ Accepted answer

specific player

local Players = game:GetService("Players")

-- get specific player
local player = Players:FindFirstChild("InsertPlayerNameHere")

-- to get the character
local character = player.Character

-- to get the humanoid from character
local humanoid = character:WaitForChild("Humanoid")

every player that joined the game

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local humanoid = character:WaitForChild("Humanoid")
	end)
end)

3 comments

0

I am stupid. Sorry for wasting your time like this, but what i meant was to get the character and Humanoid of any player using a server script, not just a specific one. Again sorry for not stating my question correctly and therefore wasting your time

0

you're not wasting my time don't worry, and you're not stupid. i added another script that gets the character and humanoid of any player in serverscript

0

thank you so much you have saved me a lot of time

This discussion is preserved as it was. New answers, comments, and votes are closed.