How does this line of script work?

game.ReplicatedStorage.Folder.State:FireClient(player, script.Parent)
end

this is a line of code from another script

game.ReplicatedStorage.Folder.State.OnClientEvent:Connect(function( stadium)

how come that i pass 2 parameters (player and script . parent) but i can only access script . parent and I cant access player .

like
when i do this game.ReplicatedStorage.Folder.State.OnClientEvent:Connect(function(player,stadium)
and print(player)
it still print (stadium)

1 Like

In the LocalScript, the player is game.Players.LocalPlayer. You don’t need it to be passed.
In the script, you can’t send the signal without specifying who to send it to. So you specify the player and then specify the data to send.

1 Like

Thankyou very much . Then how would i go about making pvp system . Like there are two part with proximity prompt . i want the two player who triggered the part to fight

Maybe bit out of topic

There’s a lot more to that than can just be explained. I’m happy to point you in the right direction when I have a keyboard in front of me, but the question you ask is quite broad. There are quite a few answers depending on how you want to do it.

1 Like