I'm working on a Party System though Gui's but everytime I try to grab someone else's PlayerGui through a Localscript it always give's me a Error saying the PlayerGui isn't found but this weird as I can do this to myself and everything works fine but when I try with others doesn't seem to work at all.

(The Inviting Part)

local PlayerID = InvitePlr.Plr.Value
if InvitePlr.PlayerCheck.Value == 1 then
if PlayerID == nil then return end
game.Players[PlayerID].PlayerGui.PartySystem.Frame.Visible = true
game.Players[PlayerID].PlayerGui.PartySystem.Frame.Message.Text = player.Name.." Has Invite you to there Party"
game.Players[PlayerID].PlayerGui.PartySystem.Frame.Yes.PlayerName.Value = ""..player.Name
print("Player has been Invited "..PlayerID)
InvitePlr.Text = "Player Invited"
Input.Text = "Type Player Name here"
wait(1)
InvitePlr.Visible = false
InvitePlr.Text = "Invite to Party?"
InvitePlr.PlayerCheck.Value = 0
InvitePlr.Plr.Value = ""
end
end)

Line 4,5,6 Are the Issue.

Edit: Got it working with RemoteEvents.

6 comments

0

Why would you be able to? A hacker could just show some bad words to some kids using a UI.

0

So, Does that mean I should use RemoteEvents?

0

Also, how come you did ""..player.Name? Why the empty string?

0

PlayerName.Value = player.Name ? Grabbing the player name and storing it into a StringValue so I can use that with the other setup when they click Yes to join to grab there name again for PlayerGui Side. But I got this working with remoteevents.

0

But why the empty string? It is like doing "function something(x) return x + 0 end". It does not do anything.