Right now I have a ScreenGui that Says Waiting for enough players, Intermission, Get Ready to play!, (It starts to countdown time remaining and says how many players are left), example KILLED example, The winner is example! and End of game. I would like for "example KILLED example" to stay up for a few seconds instead of the countdown going then "example killed example" only being up for 0.25 seconds.

MainScript is in ServerScriptService

-- Variables

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ServerStorage = game:GetService("ServerStorage")

local MapsFolder = ServerStorage:WaitForChild("Maps")

local Status = ReplicatedStorage:WaitForChild("Status")

local GameLength = 40

local reward = 50

-- Game Loop

while true do
	
	Status.Value = "Waiting for enough players"
	
	repeat wait(1) until game.Players.NumPlayers >= 2
	
	Status.Value = "Intermission"
	
	wait(10)
	
	local plrs = {}
	
	for i, player in pairs (game.Players:GetPlayers()) do
		if player then
			table.insert(plrs,player)
		end
	end
	
	wait (2)
	
	local AvailableMaps = MapsFolder:GetChildren()
	
	local ChosenMap = AvailableMaps[math.random(1,#AvailableMaps)]
	
	Status.Value = ChosenMap.Name.." Chosen"
	
	local ClonedMap = ChosenMap:Clone()
	ClonedMap.Parent = workspace
	
	local SpawnPoints = ClonedMap:FindFirstChild("SpawnPoints")
	
	if not SpawnPoints then
		print("SpawnPoints not Found!")
	end
	
	local AvailableSpawnPoints = SpawnPoints:GetChildren()
	
	for i, player in pairs(plrs) do
		if player then
			character = player.Character
			
			if character then
				
				character:FindFirstChild("HumanoidRootPart").CFrame = AvailableSpawnPoints[1].CFrame + Vector3.new(0,5,0)
				table.remove(AvailableSpawnPoints,1)
				
				
				local Sword = ServerStorage.Sword:Clone()
				Sword.Parent = player.Backpack
				
				local GameTag = Instance.new("BoolValue")
				GameTag.Name = "GameTag"
				GameTag.Parent = player.Character
				
			else
				if not player then
					table.remove(plrs,i)
				end
				
			end
		end
	end
	
	
	Status.Value = "Get Ready to Play!"
	
	wait(2)
	
	for i = GameLength,0,-1 do
		
		for x, player in pairs(plrs) do
			if player then
				
				character = player.Character
				
				if not character then
					table.remove(plrs,x)
				
				else
					if character:FindFirstChild("GameTag") then
						
						print (player.name.."Is still in the game!")
						
					else
						
						table.remove(plrs,x)
						print(player.name.."Has been removed!")
							
					end		
				end
			else
				
				table.remove(plrs,x)
				print(player.name.."Has been removed!")
					
			end
		end
		
		Status.Value = "There are "..i.." seconds remaining, and "..#plrs.." players left"
		
		if #plrs == 1 then
			
			Status.Value = "The winner is "..plrs[1].name
			plrs[1].leaderstats.Money.Value = plrs[1].leaderstats.Money.Value + reward
			break
		elseif #plrs == 0 then
			Status.Value = "Nobody Won!"
			break
		elseif i == 0 then
			Status.Value = "Times up!"
			break
		end
		
		wait(1)
	end
	
	print("End of game")
	
	wait(2)
	
	for i, player in pairs(game.Players:GetPlayers()) do
		character = player.Character
		
		if not character then
			
		else
			if character:FindFirstChild("GameTag") then
				character.GameTag:Destroy()	
			end
			
			if player.Backpack:FindFirstChild("Sword") then
				player.Backpack.Sword:Destroy()
			end
			
			if character:FindFirstChild("Sword") then
				character.Sword:Destroy()
			end
		end
		
		player:LoadCharacter()
	end
	
	ClonedMap:Destroy()
	Status.Value = "Game Ended"
	wait(2)
end

Stats is in ServerScriptServer

local DataStores = game:GetService("DataStoreService"):GetDataStore("MoneyDataStore")
local DefaultMoney = 100
local playersLeft = 0


game.Players.PlayerAdded:Connect(function(player)
	
	playersLeft = playersLeft + 1
	
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player
	
	local Money = Instance.new("IntValue")
	Money.Name = "Money"
	Money.Value = 0
	Money.Parent = leaderstats
	
	
	
	player.CharacterAdded:Connect(function(character)
		character.Humanoid.WalkSpeed = 16
		character.Humanoid.Died:Connect(function()
			
			if character.Humanoid and character.Humanoid:FindFirstChild("creator")then
				game.ReplicatedStorage.Status.Value = tostring(character.Humanoid.creator.Value).." KILLED "..player.name
				
				
			end
			
			
			if character:FindFirstChild("GameTag") then
				character.GameTag:Destroy()
			end
			
			player:LoadCharacter()
		end)
	end)
	
	--Data Stores
	
	local player_data 
	
	pcall(function()
		player_data = DataStores:GetAsync(player.UserId.."-Money")
		
	end)
	
	if player_data ~= nil then
		Money.Value = player_data
	else
		Money.Value = DefaultMoney
	end
		
end)

local BindableEvent = Instance.new("BindableEvent")

game.Players.PlayerRemoving:Connect(function(player)
	pcall(function()
		DataStores:SetAsync(player.UserId.."-Money",player.leaderstats.Money.Value)
		print("Saved")
		playersLeft = playersLeft - 1
		BindableEvent:Fire()
	end)
	
	
end)

game:BindToClose(function()
	while playersLeft > 0 do
		BindableEvent.Event:Wait()
	end
	
end)

Script is a LocalScript and is in ScreenGui.TextLabel

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

script.Parent.Text = Status.Value


Status:GetPropertyChangedSignal("Value"):Connect(function()
	
	script.Parent.Text = Status.Value
end)


2 comments

0

why am i looking at over 230 lines of code.

0

Read guidelines before posting a question. Rules clearly state "Attempts should be your own work. Don't take a free model and expect us to fix it." https://scriptinghelpers.org/help/community-guidelines even if it is not from a free model, it is not your own attempt. It is from alvinbloxx: https://www.youtube.com/watch?v=vCpl5M_9mcQ