#What am i doing wrong in this table here?

1 messages · Page 1 of 1 (latest)

ebon rock
#

"prox" is welded to the players UpperTorso btw so prox.parent.parent.parent = the player in workspace (or so i think)

stark thorn
#

can you send a photo of the explorer so i can seen the object hierarchy

ebon rock
#

yuh

earnest bluff
#

who is player2

#

or is this some kind of

#

player = player.Parent:FindFirstChild(player.Name) kind of situation?

earnest bluff
rotund tangle
ebon rock
#

player2 is the player on who the proximity prompt is welded to

earnest bluff
ebon rock
#

also do u know why the second "print(playersidtable)" is empty?

#

the table is empty thats why it comes back as nil and i have no idea why

earnest bluff
#

idk you probably did something wrong

#

just use the functions i gave you

ebon rock
#

ye but thats the entire script

ebon rock
earnest bluff
#

cloned what

#

bro read the function name, what do you think it does

ebon rock
#

ye but if ur trying to get a player from an ancestor they have that every player has then wont it not work?

earnest bluff
#

what are you on about

#

are you sober bruh

ebon rock
earnest bluff
#

Find First Ancestor Of Class

#

just ... just take a wild guess what that does

#

script: Find First Ancestor Of Class

#

What could that possible do?

#

summon an elephant and transform all the players into a cheesewheel?

#

cmon

ebon rock
#

ngl idk what "of class" means or how its different form just FindFirstAncestor:

earnest bluff
ebon rock
#

u cant hear a part?

earnest bluff
#

the class! obviously

#

they are different types of objects

#

look for .ClassName property

ebon rock
#

so part 1 and part 2 both have the same class?

#

i meant class

earnest bluff
#

look at the .classname in the properties window for anything in studio

ebon rock
#

i just did

earnest bluff
#

now look at the classname of a model

ebon rock
#

and the classes of 2 seperate parts were "Part"

earnest bluff
#

i'll give you a hint

#

ClassName

#

OfClass

#

hmm.... these things are totally unrelated and there is no pattern to recognize whatsoever

#

obviously thonkoof one says className, and the other says Ofclass. clearly they are completely different!

ebon rock
#

so if the class of a part is "Part" and that part is cloned and attached to every player, FindFirstAncestorOfClass is going to be able to tell me which player it belongs to even tho the parts ahev the same class name?

earnest bluff
#

i've seen you asking help questions a lot how have you got this far and don't know how a character is constructed...

ebon rock
#

never thoutght it was construced differently than anything else

earnest bluff
#

every player.Character points to a model bro

#

the player's character is a model

#

now if there's a script within that character, anywhere in that character

#

and you try to find it's First ancestor which is a Model ...

#

I wonder what the output of that function might be, no definitely not the player.Character, it must be something else!

ebon rock
#

ohhhh i thought u were talking about the thing i was welding to the player not the player itself

#

mb

#

but that still wont work if i cant get the table to save

earnest bluff
#

and not checking any of your assumptions

ebon rock
#

but the table isnt saving and i have no idea why and ur like the smartest dude ik about this stuff

earnest bluff
#

idk name is probably wrong add more prints, test stuff

#

don't assume

#

don't ever assume

#

always check

#

if you're going to assume anything, assume your assumptions are always wrong until you can prove they are not

#

like is player.Character always the player's character?

#

Check it.

#

is your table actually empty? check it.

#

this is probably the #1 thing that I do that many newbie developers do not

ebon rock
earnest bluff
#

they assume that somehow experienced developers just magically know exactly what to write for their code and get it correct first try every time - the reality is not like that at all. in reality, we know what to write in the code because we know how to debug and check it

earnest bluff
#

print(playeridtable)

ebon rock
# earnest bluff ya more prints

i went to a test game thing and wrote the code again and it didnt print an empty table so i copied it and pasted it over and it printed a empty table

#

the difference between the 2

earnest bluff
#

if the script runs after the first player is added, it wont fire playeradded for that player

ebon rock
#

it works now, im assuming it was the fact that i welded it to the character in a different script and that sort of stuff cuz when i changed it to this script it all worked and it works now (I prayed and 5 mins later if was fixed)

plucky river
#

nah yall be stealing my chat

plucky river