Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I am trying to Get the Textlabel to sey if the game are waiting fore more players ore. ?

ntermisjon it dosent work?

-- Dfine veriables

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ServerStorage = game:GetService("ServerStorage")

local MapsFolder =ServerStorage:WaitForChild("Maps")

local Status = ReplicatedStorage:WaitForChild("Status")

local GameLength = 50

-- Game loop

while true do

view source

Status.Value = "Waiting for enough Players"

02 03 repeat wait(1) until game.Players.NumPlayers >= 2 04 05 Status.Value = "Intermission" 06 07 wait(10) 08 09 local plrs = {} 10 11 for i, player in pairs (game.Players:GetPlayers()) do 12 if player then 13 table.insert(plrs,player) -- Add each player into plrs table 14 15 end The textlabel local skript

local Status = game:GetService("ReplicatedStorage"):WaitForChild("Status")

script.Parent.Text = Status.Value

Status:GetPropertyChangedSignal("Value"):Connect(function()

view source

1 script.Parent.Text = Status.Value end) Pleas help me i am following a video

3 comments

1

Fix your code block.

0

you could've at least help him.

1

You duplicated your question, yet you made the same code block and grammatical mistake.

1 answer

game.Players.PlayerAdded:Connect(function(player)
	local text = script.Parent
	local players = game.Players:GetPlayers()
	local maxplr = 2 --change 2 to how much players you want
	local calculate = tonumber(#players) - maxplr
	text.Text = tostring(calculate)
end)

game.Players.PlayerRemoving:Connect(function(playerleft)
	local text = script.Parent
	local players = game.Players:GetPlayers()
	local maxplr = 2 --change 2 to how much players you want
	local calculate = tonumber(#players) - maxplr
	text.Text = tostring(calculate)
end)

idk if this works but that's pretty much what I can help, if it doesn't work, please try to be as specific as you can. Stay safe.

This discussion is preserved as it was. New answers, comments, and votes are closed.