So i have a local script that fires a remote, the remote is being fired, but the value with it is not correct, instead of printing the desired value on the local, it's printing the player's name, there are the scripts related to that function:
Server
remote = script.Parent.ValueStorage:WaitForChild("SwitchModes") remote.OnServerEvent:Connect(function(currentmode) print(currentmode) end)
Local (not full script)
currentmode = "Stun" -- all functions related to the value that's supposed to be sent to server. script.Parent.ValueStorage.SwitchModes:FireServer(currentmode)
I suppose that the remote is printing the value that already comes with the remote, when its fired, the player, but its printing the name and not the player model, so i really don't know what exactly is going on. help would be appreciated...
When Fireing from Client to Server the first argument will always be the player that fired it, then whatever you passed. so in the server script it should be
remote = script.Parent.ValueStorage:WaitForChild("SwitchModes") remote.OnServerEvent:Connect(function(Player,currentmode) print(currentmode) end)