#What am i doing wrong in this table here?
1 messages · Page 1 of 1 (latest)
can you send a photo of the explorer so i can seen the object hierarchy
why do you need player2 in there
who is player2
or is this some kind of
player = player.Parent:FindFirstChild(player.Name) kind of situation?
you already have the player by the event parameter player why do you need to fetch it a second time
You don’t need to store the players userid, you can just get it if you have the player object
player2 is a different player than who triggered the proximity prompt
player2 is the player on who the proximity prompt is welded to
playerWhoOwnsProxyPrompt=Players:GetPlayerFromCharacter(script:FindFirstAncestorOfClass("Model"))
will that still work if every player has the "Model"?
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
ye but thats the entire script
will that work if every player has a cloned version of the model attatched to them?
ye but if ur trying to get a player from an ancestor they have that every player has then wont it not work?
i think it finds the player by an ancestors name thats attached to their character
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
ngl idk what "of class" means or how its different form just FindFirstAncestor:
what's the difference between a part, a proximity prompt, and a sound, in roblox studio?
u cant hear a part?
the class! obviously
they are different types of objects
look for .ClassName property
look at the .classname in the properties window for anything in studio
i just did
now look at the classname of a model
and the classes of 2 seperate parts were "Part"
and then tell me what could possibly be the difference between FindFirstAncestor, and FindFirstAncestorOfClass
i'll give you a hint
ClassName
OfClass
hmm.... these things are totally unrelated and there is no pattern to recognize whatsoever
obviously
one says className, and the other says Ofclass. clearly they are completely different!
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?
i've seen you asking help questions a lot how have you got this far and don't know how a character is constructed...
never thoutght it was construced differently than anything else
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!
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
you're overthinking way too much
and not checking any of your assumptions
but the table isnt saving and i have no idea why and ur like the smartest dude ik about this stuff
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
i did that how i knew it was empty
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
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
if the script runs after the first player is added, it wont fire playeradded for that player
wdym?
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)
nah yall be stealing my chat
bros still using light mode