How exactly would I fire a specific client from an argument passed with a remote function from client to server? I have a clan system and players can invite others to their clan.
So when they go to invite someone a GUI opens and it has a list of players and an invite button for each. For handling that I have this:
for i, button in pairs(clanFrame.Container.inviteFrame.ScrollingFrame:GetDescendants()) do
if button:IsA("TextButton") then
button.Activated:Connect(function()
replicatedStorage.inviteClan:FireServer(button.Parent.Name)
end)
end
end
The name of the button’s parent is the name of the player that needs to be invited. The server then :FireClient() with that argument.
function invite(reqplayer)
ReplicatedStorage.createMsg:FireClient(reqplayer)
return true
end
ReplicatedStorage.inviteClan.OnServerEvent:Connect(invite)
The reqPlayer is the client that needs to be fired. So why doenst it work? It ends up firing the client that sent it so it results in the GUI on their screen not who the invite needs to be sent to.