Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Locating character from player?

Asked by 8 years ago

Im using a local script located in starterGUI. I need to acces the humanoid in the player. How do i do it? thanks for helping :)

x = game.Players.LocalPlayer
Humanoid = x:GetPlayerFromCharacter(Humanoid)

P.s i know this is wrong, but im tryna use it as a guide line?

2 answers

Log in to vote
0
Answered by 8 years ago

to get the humanoid, you can do the following:

x = game.Players.LocalPlayer
Character = x:WaitForChild("Character")
Humanoid = Character:FindFirstChild("Humanoid")

Hope this helps!

0
thanks :) Bubbles5610 217 — 8y
0
No problem! Thundermaker300 554 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

You cannot do x:WaitForChild("Character") since it isnt a Child, its a propertie. To access the character you'd do

local Character = x.Character or x.CharacterAdded:wait()
0
Property* NoCollider 5 — 8y

Answer this question