How would I go about creating a Countdown GUI Command?

local Admins = {2702968750}
local Prefix = ":"

game.Players.PlayerAdded:Connect(function(Player)
	Player.Chatted:Connect(function(msg)
		local Admin = table.find(Admins, Player.UserId)
		local Args = string.split(msg," ")
		if (Args[1] == prefix.."countdown") and (Admin ~= nil) then
			local CountdownValue = tonumber(Args[2])
			while CountdownValue > 0 do
				CountdownValue = CountdownValue - 1
				wait(1)
			end
		end
	end)
end)

That is my current script, but how would I implement a GUI to it?

You would need a remote event connected to a local script which would control the GUI.

is there a way in script I can do that?

what is the screengui’s name and what is the textlabel’s name and the ancestors

the countdown gui is called CDGUI and the textlabel is under the CDGUI and called time

local Admins = {2702968750}
local Prefix = ":"

game.Players.PlayerAdded:Connect(function(Player)
	Player.Chatted:Connect(function(msg)
		local Admin = table.find(Admins, Player.UserId)
		local Args = string.split(msg," ")
		if (Args[1] == prefix.."countdown") and (Admin ~= nil) then
			local CountdownValue = tonumber(Args[2])
			while CountdownValue > 0 do
				player.PlayerGui.CDGUI.time.Text = tostring(CountdownValue)
				CountdownValue -= 1
				wait(1)
			end
		end
	end)
end)

all i did is add a updater

is there any problems? let me know!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.