You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve?
im trying to make a party system but I need to create a working invite system -
What is the issue?
instead of the gui firing on the plr Invited it fires on my client
-
What solutions have you tried so far?
I’ve tried firing it from server to client it never worked
local Invplr = game.Players.LocalPlayer
local debounce = false
local PartySearch = script.Parent
local Rep = game:GetService("ReplicatedStorage")
local Invite = Rep:WaitForChild("Combat").InvitePlr
local TweenService = game:GetService("TweenService")
for i, v in pairs(game.Players:GetChildren()) do
local Gui = Rep:WaitForChild("PlayerFRame"):Clone()
Gui.Parent = PartySearch
Gui:FindFirstChild("TextLabel").Text = v.Name
Gui.Name = (v.Name).. " Invite"
if v.Name == Invplr.Name then
Gui.Visible = false
end
Gui:FindFirstChild("TextButton").MouseButton1Click:Connect(function()
if not debounce then
debounce = true
Gui:FindFirstChild("TextButton").Visible = false
Invite:FireServer(v)
local plrPartyMenu = Rep:WaitForChild("PlrPartyMeny"):Clone()
plrPartyMenu.Parent = script.Parent.Parent.YourPart
plrPartyMenu.TextLabel.Text = Invplr.Name
end
end)
end
local Rep = game:GetService("ReplicatedStorage")
local Invite = Rep:WaitForChild("Combat").InvitePlr
local TweenService = game:GetService("TweenService")
local Accept = Rep:WaitForChild("Combat").AcceptPop
Invite.OnServerEvent:Connect(function(v, ...)
local PartyAccept = Rep:WaitForChild("PartyAccept"):Clone()
PartyAccept.Parent = v.PlayerGui.ScreenGui
PartyAccept.Position = UDim2.new(-1, 0,0.005, 0)
PartyAccept:FindFirstChild("TextLabel").Text = "Someone wants to invite you"
if PartyAccept then
TweenService:Create(PartyAccept, TweenInfo.new(1), {Position = UDim2.new(0.005, 0, 0.005, 0)}):Play()
end
end)