im trying to make a userinputfield that authorizes certain players to go through a door
this is the local script that the user inputs
local LocalPlayer = game.Players.LocalPlayer
allowedplayers = {"me"}
textbox.FocusLost:Connect(function(enterpressed)
if enterpressed then
local text = textbox.Text
table.find("allowedplayers")
allowedplayers = ("allowedplayers", text)
end
print(text)
end
end)
this is the server script
local UnlockOwnerDoorEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
if table.find(allowedplayers, Player.Name) then
UnlockOwnerDoorEvent:FireClient(Player)
end
end)```