-
What do you want to achieve? Keep it simple and clear!
I want to add 2 values (like a player name and a proximity prompt) and then retrieve the player name and the proximity prompt -
What is the issue? Include screenshots / videos if possible!
I’m not the best with tables so its kinda hard for me, but I’m still trying to learn more about tables and dictionaries -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried YT and Devforum.
Nevermind, i found another way around it, but its not as efficient as the table
Use a dictionary. You can set the key as the player and the value as a proximity prompt.
Code:
local values = {}
values[Players.MyCoolPlayer] = ProximityPrompt
Ok, how could i retrieve the data?
local proximityPrompt = values[Players.MyCoolPlayer]
all good and all, but how can i check if the players name and the proximity prompt exist in the table, basically and if statement. would it be if table.find() then ? or since its a dictionary is it something else?
local proximityPrompt = values[Players.MyCoolPlayer]
if proximityPrompt then
-- Code
end
Ok ill try this and ill let u know if it works
THANKS SO MUCH FOR UR HELP, however i wish i could mark ur other code as the solution too, cus both codes helped me
No problem. By the way, it would probably be easier to index by the player itself, instead of the player’s name.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.