Hello!
So in my game I have a gui with parties that a player can click on to join, and then the party leader will have a gui pop up that asks if they either accept or decline the join request.
This is the code I have, that is fired from a remote even when the join button is clicked. It will put the pop up on the creator's screen.
game.ReplicatedStorage.JoinRequestSend.OnServerEvent:Connect(function(player)
local guiButton = player.PlayerGui.FactionSelect.Main.PartiesList.Party.JoinParty
local creatorName = guiButton.Parent.PartyCreator.Value
local players = game:GetService("Players")
local creator = nil
for i, player in pairs(players:GetPlayers()) do
if player.Name == creatorName then
creator = player
end
end
local popup = game.ServerStorage.JoinReq:Clone()
popup.Parent = creator.PlayerGui
end)
Even though the PartyCreator value is the correct name of the player, when I try to find the creator's player based on that value, it gives me this error and the gui does not pop up:
11:03:09.797 - ServerScriptService.JoinRequestSendReciever:13: attempt to index local 'creator' (a nil value)
Sorry, the answer is probably obvious... I will be extremely thankful if someone can help me figure out how to get this working...

1 comment
solved it myself with the assistance of chess123mate. I had to send creatorName through the firing of the remote event