I understand that you can find the players name through the parameters. Like this:
script.Parent.Touched:connect(function(hit) print(hit.Parent.Name) end)
But can you find the player's name, store it in a table (not using data store), and reference(find) it when needed?
I have this:
local PlayerTable = {} script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then -- for checking purposes if --[[DOESN'T FIND NAME IN TABLE--]] then table.insert(PlayerTable,hit.Parent.Name) end end end)
If there are any wiki pages on this please send the links
Ohhhhhhh, are you're trying to maybe make a debounce for specific players? I guess I'll just answer your question first:
You can store a string into a table and reference it easily like this:
local tb = {} tb[string] = true if tb[string] then -- this will get ran end
Adding this to your script:
local PlayerTable = {} script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then -- for checking purposes if not PlayerTable[hit.Parent.Name] then PlayerTable[hit.Parent.Name] = true end end end)
That will make it so the code will only run for players once. I think this is what you wanted.