Remote event detecting player for some reason

  1. I am trying to make a system where you can identify people who have the same role as you. A red box appears around both of the people who have the same role.

  2. I used a function to activate whenever this happens:
    Screen Shot 2021-12-30 at 11.19.00 PM
    Screen Shot 2021-12-30 at 11.19.11 PM
    In the function it shows this:


    Local script:

    Ouput:
    Screen Shot 2021-12-31 at 10.06.42 AM
    Btw game.ReplicatedStorage.RoleValues is here: Screen Shot 2021-12-31 at 10.12.49 AM
    (The role value values go higher when a role gets picked.) (There’s also rolevalues located in the player. They get higher when the player is that role.

  3. I’ve tried to look on devforum but can’t find anything similar to this.*

What is “role” set to? I am talking about the local function in the server script.

I posted a screenshot here. Is this what you were talking about?

1 Like

The first parameter of a remote event being received on the server is always the player.

Do I make a second parameter for the remote event?

The player parameter is passed by default to the server, therefore role gets equal to player. Instead you should replace function(rolethingy) with function(player, rolethingy).

1 Like

What were you trying to do?

If I am not wrong, you tried to find a string called “Werewolf” in the player, which is impossible to my knowledge.

(Nevermind, I just remembered what [] does.)

Okay, I will go do that right now. Is that all that is wrong?

Well this is the reason the topic was made, your code may have other bugs/vulnerabilities which are irrelevant to the current discussion.