I tried like this but I'm not getting the parameter in the server script.
1 | remote:FireServer(plrname) |
Hi, this is an example of passing arguments using events:
01 | --||LocalScript||-- |
02 | local remote = game.ReplicatedStorage:WaitForChild( "RemoteEvent" ) --Change this to where your remote is |
03 |
04 | remote:FireServer( 2 ) |
05 |
06 | --||ServerScript||-- |
07 | local remote = game.ReplicatedStorage:WaitForChild( "RemoteEvent" ) --Change this to where your remote is |
08 |
09 | remote:OnServerEvent:Connect( function (playerWhoFiredEvent, number) |
10 | print (number) --This will print 2 |
11 | end ) |
From this example, I believe you now know how to pass arguments from LocalScript to ServerScript.
Hope this helps!