#how to i get a humanoid from a players char

103 messages · Page 1 of 1 (latest)

visual talon
#

heres what i got

#

this is the local script if needed

wind pier
#

try this
local player = game.Players.LocalPlayer
local character = player.CharacterAdded:Wait()

craggy hatchBOT
#

studio** You are now Level 1! **studio

wind pier
#

idk if it's gonna work im a noob at scripting

#

but to get the character from a player this worked for me

visual talon
#

like this?

#

i had this

#

still doesnt work

wind pier
#

replace the 2nd line with local player = game.Players.LocalPlayer

#

and remove the third

nocturne sundial
#

One message removed from a suspended account.

#

One message removed from a suspended account.

visual talon
#

yes

wind pier
#

make sure the local script is in starter playerscript

visual talon
#

its a script not a local script

wind pier
#

oh

nocturne sundial
#

One message removed from a suspended account.

wind pier
#

i don't think LocalPlayer work in server script but im not sure

visual talon
nocturne sundial
#

One message removed from a suspended account.

visual talon
#

dident know that

#

thanks

nocturne sundial
#

One message removed from a suspended account.

visual talon
#

ohh

#

thanks

#

this is very usefull

#

it works

nocturne sundial
#

One message removed from a suspended account.

visual talon
#

@nocturne sundial btw how to i get the humanoid

bold hearth
#
local plr = game.Players.PlayerAdded:Wait() or game.Players.LocalPlayer
bold hearth
visual talon
#

not anymore

#

asking a dif thing

#

oh wait forgor to change it

#

the name

#

of this post

#

how to get humanoid from the players char

bold hearth
#
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
visual talon
#

did some magic and this is the error i had before i changed the post @bold hearth

bold hearth
#

use

local character = plr.Character or plr.CharacterAdded:Wait()
#

like i sented before

bold hearth
#

simple

#

just input this to ur script

#

oh

#

you got not player

#

get plr and then insert strings that i sented you

exotic oriole
exotic oriole
#

tysm man

visual talon
#
print('Test')
#

woah

visual talon
#

how to i get a humanoid from a players char

visual talon
#

look i need to get humanoid and only humanoid

craggy hatchBOT
#

studio** You are now Level 7! **studio

visual talon
bold hearth
visual talon
#

allright

#
local RE = game.ReplicatedStorage.GiveHPBar
local frame = script.Parent
local label = frame.Label
local meter = frame.Meter
local humanoid = game.Players.LocalPlayer.Character:WaitForChild('Humanoid')

label.Text = humanoid.Health .. '/' .. humanoid.MaxHealth
meter.Size = UDim2.new(humanoid.Health / humanoid.MaxHealth, 0, 1, 0)

humanoid:GetPropertyChangedSignal('Health'):Connect(function()
    label.Text = humanoid.Health .. '/' .. humanoid.MaxHealth
    meter.Size = UDim2.new(humanoid.Health / humanoid.MaxHealth, 0, 1, 0)
end)
exotic oriole
# visual talon

What he is saying is that you HAVE to get player and character to get the humanoid.

local player = game.Players.LocalPlayer
local Character = player.Character or player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
visual talon
visual talon
visual talon
exotic oriole
craggy hatchBOT
#

studio** You are now Level 1! **studio

exotic oriole
#

if it is getting moved to a character tho, you can simply put

local Humanoid = script.Parent:WaitForChild("Humanoid")
visual talon
#

so i have the script inside of a billboardgui thats in replicated storage and then i have 2 scripts one is local and one is server the local one send remote to the server to clone the billboardgui into the players char

exotic oriole
#

So ultimately, the script where you are trying to get the player's humanoid is inside of the billboardgui, that is parented to the player's character?

visual talon
#

yes

exotic oriole
#
local Humanoid = script.Parent.Parent:WaitForChild("Humanoid")
visual talon
#

offical thing

exotic oriole
visual talon
#

alr

#

@exotic oriole

exotic oriole
#

lol i see whats up

#

add another parent

#
local Humanoid = script.Parent.Parent.Parent:WaitForChild("Humanoid")
visual talon
#

it works

#

YAY

exotic oriole
#

:)))

visual talon
#

0% error

#

you sigma skibdi rizzler

exotic oriole
#

lol anytime. i suggest you do some more digging into the basics of lua; will save you a lot of future headaches

visual talon
#

forgor to turn regen of put it works tested it in local test

nocturne sundial
#

One message removed from a suspended account.

visual talon
#

i was wondering how to you like move/teleport parts?

#

might add a test dummy with respwan'

#

do you have to use vector3 put then how

#

@here

nocturne sundial