How do I put a username of a player that touched a part in a string. This is my attempt, but there is no error and it doesn't work. Btw I am working on an admin pad (kohls).
game.Workspace.AdminPad.Touched:Connect(function(hit) local player = hit.Parent.Name local str1 = [["]] local Owners={} local SuperAdmins={} local Admins={} local Mods={str1..player..str1} local VIP={} end)
game.Workspace.AdminPad.Touched:Connect(function(hit) local player = hit.Parent:FindFirstChild("Humanoid") -- Looks for the humanoid to ensure the part was a player if player ~= nil then -- Checks if the part was a player player = player.Parent.Name else return end local str1 = "\"" -- Escape sequence which allows the string to show up as a quotation mark '"' local Owners={} local SuperAdmins={} local Admins={} local Mods={str1..player..str1} local VIP={} end)
I think this is what you were attempting to do. It places the players name in the Mods array as "PLAYERNAME". If you don't want the quotation marks, remove the str1 variable.