Server Script:
game.ReplicatedStorage.Command.OnServerEvent:Connect(function(Player, commandText)
print(commandText)
end)
Local Script:
game.ReplicatedStorage.Command:FireServer(game.Players.LocalPlayer, “Kill”)
Output
caneeeeee
Server Script:
game.ReplicatedStorage.Command.OnServerEvent:Connect(function(Player, commandText)
print(commandText)
end)
Local Script:
game.ReplicatedStorage.Command:FireServer(game.Players.LocalPlayer, “Kill”)
Output
caneeeeee
You don’t need to pass a Player
object when firing from the client - it will be passed automatically.
Instead, your client code should look like:
game.ReplicatedStorage.Command:FireServer(“Kill”)
Could you show me a tiny snippet showing how to get the player?
Sure!
Client:
remote_event:FireServer("Kill")
Server:
remote_event.OnServerEvent:Connect(function(plyr: Player, foo: string)
print(plyr.Name, foo)
end
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.