Hi Guys,
So Im using RemoteFunctions to send the player name to a serverscript. The server script has a table of strings that are player names. Ive checked and confirmed that the for loop is iterating through the table and that the player name is also correct. any help please?
checkRF = game.ReplicatedStorage.ReportAPI_Config.CheckAdmin AuthorisedUsers = {"ff","test1","test","t","MrTomasboy","h"} function CheckTable(plr) for i,v in pairs(AuthorisedUsers) do if v == plr then print("MATCH FOUND") return plr else print("NO MATCH") end end end checkRF.OnServerInvoke = CheckTable
You have two problems. First on the line 6. You cant equal string to the object, so you need to change code on that line. Second is that you set your function activating incorrect on the last line. Here is the correct code
checkRF = game.ReplicatedStorage.ReportAPI_Config.CheckAdmin AuthorisedUsers = {"ff","test1","test","t","MrTomasboy","h"} function CheckTable(plr) for i,v in pairs(AuthorisedUsers) do if v == plr.Name then print("MATCH FOUND") return plr else print("NO MATCH") end end end checkRF.OnServerInvoke:Connect(CheckTable)
I think it will be working.
P.S sorry for my english. I hope you understand what I mean