#how do i reference the player character from within a script, within a tool?

88 messages · Page 1 of 1 (latest)

elder nexus
#

Where's the tool parented?

storm urchin
#

starterpack

grizzled snow
#

?

elder nexus
#

Ok so, when a player joins the game, the tool will clone and parent to player's backpack, so if you have the scrip inside the tool, you could do

local plr = script.Parent.Parent.Parent
print(plr)

And it should print your name

waxen chasm
#

in the other post

elder nexus
#

Thats for a server script, but if its a local script, you could just do

local plr = game.Players.LocalPlayer
storm urchin
#

that didnt seem to work

elder nexus
#

Any errors or anything?

grizzled snow
elder nexus
#

Ig yea, it would work like that too

storm urchin
#

still didnt work

#

literally all im asking for is to define the player character from a script thats in a tool thats in the starterpack

woven fox
#

did you reference the character

storm urchin
#

well no ive been trying to do that

woven fox
#

what is it printing when you print plr

storm urchin
#

i dont need to print anything

elder nexus
#

Printing is a really helpful thing in script

woven fox
#

yeah

elder nexus
#

Do a print and see what you get

woven fox
#

it tells you exactly what the script sees

storm urchin
#

or you can just tell me how to define the character from the script in the tool

#

thats in the starterpack

woven fox
#

ok but we need to know what the script sees and kind of go from there

elder nexus
storm urchin
#

i just need to get the position of the humanoidrootpart

woven fox
#

i think its something like plr.Character:WaitForChild('HumanoidRootPart')

storm urchin
#

yeah well plr isnt referenced yet so the script doesnt know what plr is

#

because like i said i still havent referenced the goddamn fucking player character

#

theres no way its this complex bro

elder nexus
#

Its not, but we also need your help to tell us what the fuck is plr for you

woven fox
#

jeez

#

calm down guys

storm urchin
#

bro i dnt even know what plr is

elder nexus
#

Im starting to get mad, its like talking to a wall

storm urchin
#

no it isnt

#

all im trying to do is define the character

#

just the character

storm urchin
#

any part of the body

woven fox
#

ok well im pretty sure you can't reference a player's tool through the starterpack

elder nexus
#

All you need

storm urchin
# waxen chasm swearing

yes this is discord a 13+ platform so if you cant handle a little bit of swearing go onto whatsapp or something buddy

elder nexus
#

Now do a print(plr) and tell us what you get

storm urchin
#

thanks bro

elder nexus
elder nexus
woven fox
#

im pretty sure you have to reference a tool through the player's backpack though

storm urchin
waxen chasm
storm urchin
#

sorry fucking loser!

waxen chasm
#

and you just admitted

storm urchin
#

so?

#

got a problem with gays?

#

damn bro you're a bigot!

waxen chasm
#

ok

storm urchin
#

leave the server

#

you basically just admitted to being homophobic LOL

elder nexus
#

Yea.... While trying to shame me for saying fuck...

woven fox
#

damn

waxen chasm
#

i dont remember saying i hate gay people

storm urchin
#

i say im gay then

#

and then you say

#

"exactly you just admitted"

#

that really insinuates like theres a problem with me being gay

#

im not gay btw

smoky summit
elder nexus
#

Saying "this is bad" followed by "this is for X people" its just a stupid thing to say, it means you have problems with X peoples

woven fox
#

man when did this go wrong

lament coralBOT
#

studio** You are now Level 2! **studio

smoky summit
#

Mods shut this down

storm urchin
#

well when elpromaximus joined

waxen chasm
elder nexus
storm urchin
#

big deal

waxen chasm
#

buye bye

elder nexus
#

bye

storm urchin
#

yeah it says everything about your intolerance of difference

elder nexus
#

also nobody will help you with your "problem" (ElPro)

woven fox
#

ok so the tool script thing

elder nexus
#

It should be done, I even test it