But the Numbers 123 was random i want to compare the Code what a Player is sending from the Client with a RemoteEvent to the Server, but it will not compare the 123 (code) with the dictionary. Just if the variable is created inside the Server

1 Like
local dictionary =  match[tostring(player.UserId)]
if dictionary[2] == code then

Also, try to print out some stuff, like - the code, etc. And see what returns

1 Like

Its returning nothing but i worked now but its weird.

I dont send the …TextBox.Text with a RemoteEvent to the Server first i put the …TextBox.Text inside a NumberValue and send it to the Server. It worked. But why its just working with the Value? Learned something new, but thank you for your help

1 Like

I think I am confused a bit, so I might not understand you for 100%.

local players = {
   ["95968697"] = {50,100,150}

    print(players[tostring(Sender.UserId)][2] -- does it print?
    print(players[tostring(Sender.UserId)] -- does it print?
    print(Code) -- does it print?
    if players[tostring(Sender.UserId)][1] == Code then
    print("success") -- does it print?

Also, if your keys inside the dictionary have tables as their values, I suggest arranging them in 1 line, it’s more clear.

If any of the prints don’t print out, it means there’s an issue nearby that print. [not below, but before that print]

1 Like

I mean this


script.Parent.Parent:WaitForChild("NumberValue").Value = script.Parent.TextBox.Text --If i wouldnt send it with the NumberValue it would not work.



print(code) -- And it worked. If i wouldnt put the Code inside the Textbox.Text to the NumberValue and send it trought the NumberValue it would not work. But i dont know why, its weird, because it printet the Number in both.

1 Like