local Players = game:GetService("Players")

wait(0.5)

game.Players.PlayerAdded:Connect(function(plr)
	local char = game.Workspace:FindFirstChild(plr.Name)
	local gui = plr.PlayerGui.SystemGui
	if plr and char and gui then
		local function Intermission()
			print("intermission")
			gui.Intermission.Visible = true
			local timer = 30
			gui.Intermission.Text = "Intermission : "..timer
			repeat wait(1)
				timer = timer - 1
				gui.Intermission.Text = "Intermission : "..timer
			until timer == 0
			gui.Intermission.Visible = false
		end
		
		Intermission()
		
		local function Load()
			print("load")
			local arenas = game.ServerStorage:WaitForChild("Arenas"):GetChildren()
			local bosses = game.ServerStorage:WaitForChild("Bosses"):GetChildren()
			gui.Loading.Visible = true
			--Arena
			local randomarena = arenas[math.random(1,#arenas)]
			local CA = randomarena:Clone()
			CA.Parent = game.Workspace.Arena
			CA.Name = randomarena.Name
			--Boss
			local randomboss = bosses[math.random(1,#bosses)]
			local CB = randomboss:Clone()
			CB.Parent = game.Workspace.Arena
			CB.Name = randomboss.Name
			wait(2)
			gui.Loading.Visible = false
		end
		
		Load()
		
		local function Start()
			print("start")
		end
		
		Start()
		
		local function End()
			print("end")
			Intermission()
		end
		
		char:WaitForChild("Humanoid").Died:Connect(function()
			print("died")
			End()
		end)
	else
		warn("Error")
	end
end)

Script location : ServerScriptService

Script type : Script

Error(s) : None

Problem : I'm trying to do a system for my game (intermission, etc...) and i can't call any function, nothing is happening.

Note : The script is unfinished but this will change nothing if i finish it.

2 comments

0

How about not making the functions local in a server script

0

local or not, it does nothing