You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I simply wanted to make a party system that use gui. I want to separate each function event for example, Create Party, Join Party, Leave Party. I made a code that creates folder ( Party ) and stringvalue ( player ) inside. Currently looking for solution about the issue.
- What is the issue? Include screenshots / videos if possible!
I want to check if player press the join party button and get party or partyfolder that player want to join into. I want to get the PartyFolder from “CreateParty” function that has local PartyFolder = Instance.new("Folder", Parties)
and check player who press the button to join party.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Debris = game:GetService("Debris")
local Data = require(ReplicatedStorage.ModuleScripts.Data)
local PartySystemRemote = ReplicatedStorage.PartySystemRe
local HostAuthorityRemote = ReplicatedStorage.HostAuthorityRe
local Parties = ReplicatedStorage.Parties
local CloneFolder = ReplicatedStorage.CloneFolder
local scrollingframe
local host_POSITION = 1
local partylist = {}
local host, nonehost, member
local function UpdateParty(PartyFolder : Folder, player : Player)
for i, v in pairs(PartyFolder:GetChildren()) do
print("PLAYER INSIDE PARTY :", v)
if v.Value == "Host" then
print("HOST :", player)
HostAuthorityRemote:FireClient(player, true)
elseif v.Value == nil then
print("NONE HOST :", player)
HostAuthorityRemote:FireClient(player, false)
end
end
end
local function CreateParty(player : Player)
local PartyFolder = Instance.new("Folder", Parties) -- CREATE
PartyFolder.Name = "PartyFolder"
local Player = Instance.new("StringValue", PartyFolder) -- CREATE
Player.Name = player.Name
Player.Value = "Host"
for i, v in pairs(Parties:GetChildren()) do -- Change folder name and insert in table
if v:IsA("Folder") then
v.Name = i
end
end
table.insert(partylist, PartyFolder)
scrollingframe = player.PlayerGui.AllGui.PartyPage.PartyCreatePage.TextList.ScrollingFrame
UpdateParty(PartyFolder, player)
end
local function JoinParty()
-- This is where i want to check for player who join the party.
end
PartySystemRemote.OnServerEvent:Connect(function(player, PartyEvent)
if PartyEvent == "Create" then
CreateParty(player)
print("PARTY LIST :", partylist)
end
end)
I don’t want to follow some tutorial or get a model, because I want to practice myself with my own coding skill. If you can give me some suggestion or a fix. Please let me know.