So, My script runs the code below when a player joins the game
local serverStorage = game:GetService("ServerStorage")
local replicatedStorage = game:GetService("ReplicatedStorage")
local status = replicatedStorage:WaitForChild("Status")
local minPlayers = 1
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if #game.Players:GetPlayers() >= minPlayers then
print(#game.Players:GetPlayers())
status.Value = player.Name.." has joined the game"
end
end)
end)
"Status" is in the replicated storage and is used as the text for the TextLabel in my GUI. Here is the local script controlling that textlabel:
local replicatedStorage = game:GetService("ReplicatedStorage")
local status = replicatedStorage:WaitForChild("Status")
local label = script.Parent:WaitForChild("TextLabel")
status:GetPropertyChangedSignal("Value"):Connect(function()
print("status changed")
label.Text = status.Value
end)
Summary: When status' value has changed, update the textlabel

1 comment
Thanks! I was going to use remote events but I thought that since ReplicatedStorage is accessible by both server and client I could just use that instead.