I’m currently coding for a GUI that shows people who join a “Party” and also can join or leave the party.
I’m able to get it to show up for an individual person with no problem. However I was struggling to get the same values to show for all players. I tried using a bindable event that seems to fire on the local script, but doesn’t actually run.
Local Script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService('Players')
local TeamString = ReplicatedStorage.TeamString
local MyPlayer = game.Players.LocalPlayer
local StringEvent = ReplicatedStorage.StringEvent
local TeamsFrame = script.Parent
local Party1 = TeamsFrame.Party1
local P1Join = Party1.Join
local function OnActivated()
TeamString.Value = MyPlayer.Name
StringEvent:Fire()
end
P1Join.Activated:Connect(OnActivated) -- to join team
Script – I tried getting it to work two ways here, on replicated value changed and the bindable event
Local Script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TeamString = ReplicatedStorage.TeamString
local StringEvent = ReplicatedStorage.StringEvent
local TeamsFrame = script.Parent
local Party1 = TeamsFrame.Party1
local P1Join = Party1.Join
StringEvent.Event:Connect(function()
print("hello")
P1Player1.Text = TeamString.Value -- Player 1 team slot
end)
TeamString.Changed:Connect(function()
P1Player1.Text = TeamString.Value -- player 1 team slot
end)
How can I get the string value to show up for all players when someone joins a team in the gui?