Hello, this is probably a very basic question but couldn’t figure it out, what I’m trying to accomplish is having the local player click another player, then from the remote event send the other player a GUI. The problem is, when the local player clicks the other player it fires the remote event and in the server-side indexes only the local player in the output. I’m not sure what I’m doing wrong, so for now I only want help to get the other player.
The script for clicking the other players is located in StarterPlayer → StarterPlayerScripts in a LocalScript
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Event = game.ReplicatedStorage.RequestEvent
Mouse.Button1Down:Connect(function()
if Mouse.Target.Parent:FindFirstChild("Humanoid") then
local Player2 = game.Players:GetPlayerFromCharacter(Mouse.Target.Parent)
Event:FireServer(Player,Player2)
print(Player)
print(Player2)
end
end)
the output for this is correct, indexing player1 and 2 correctly
In ServerScriptService in a Script
local Event = game.ReplicatedStorage.RequestEvent
Event.OnServerEvent:Connect(function(Player,Player2)
-- For now just how to get both players correctly
print(Player)
print(Player2)
end)
For some reason unknown to me the output is only the local player, e.x: Notrealac0unt/Notrealac0unt, I’m not sure as for the reason to this so any help is appreciated! Thanks in advanced
~Notrealac0unt