Script Swaps Variable?! [solved in 2 second]

I have been working for like 2 hours on this script getting it work and when it finnaly does work, the variables just swap and idk why :sob:
Im sending 2 variables from local to server script using remote event.
the first variable is the input of the player, of we can just say a normal string.
the second is the player name

local script

script.Parent.SelectNameEvent:FireServer(SelectedName, player.Name)
print(SelectedName)
print(player.Name)

as you can see the script is sending the selectedname and the player.name,
when it prints, it prints correctly
everything is fine here
but in the server script

script.Parent.OnServerEvent:Connect(function(SelectedName, player)
     print(player)
     print(SelectedName)
end)

now when it prints here
it prints the player as the selectedname and the selectedname as the player

I just need to know why its doing this, or if its a roblox bug idk

image
:skull::skull::skull:

The first argument to a OnServerEvent callback is always the player that fired the remote.

1 Like

bro it took you 2 seconds to fix it, bro im just an idiot

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.