Hi, I have a problem with my table. I am firing a RemoteEvent with a string. My other script receives the string and if the string is in the table then the script will work. If not, it will print that the string does not exist. So it prints that the string does not exist, but it does?
Script 1:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Events = ReplicatedStorage:WaitForChild("Events") local ServerEvents = Events:WaitForChild("ServerEvents") local RemoteEvent = ServerEvents:WaitForChild("LoadRobbery") local Robbery = "ImpossibleJewelry" RemoteEvent:FireServer(Player, Robbery)
Script 2:
RemoteEvent.OnServerEvent:Connect(function(Player, Robbery) local AvailableRobberies = {"ImpossibleJewelry"} if table.find(AvailableRobberies, Robbery) then print("Result") else print("The robbery name does not exist!") end end)