Intermission script not working

Goal is to make a intermission GUI, but it is not teleporting the player after the intermission is over.

local seconds = 20
local banana = true
local player = game.Players.LocalPlayer

while banana == true do
	seconds = seconds - 1
	script.Parent.TextLabel.Text = "Next round in " ..seconds
	wait(1)
	if seconds <= 0 then
		banana = false
		-- damap 1 is empire damap 2 is wasteland
		local damap = math.random(1,2)
		if damap == 1 then

			if player.Team == game.Teams.Knight then
				print("yeet")
				player.Character.HumanoidRootPart.CFrame = CFrame.new(224, 16.5, 113)
			elseif player.Team == game.Teams.Swordsman then
				print("yeeto")
					player.Character.HumanoidRootPart.CFrame = CFrame.new(-94, 16.5, 111)
			end
		elseif damap == 2 then
			if player.Team == game.Teams.Knight then
				print("yeet")
				player.Character.HumanoidRootPart.CFrame = CFrame.new(-653, 7.16, -606)
			elseif player.Team == game.Teams.Swordsman then
				print("yeeto")
				player.Character.HumanoidRootPart.CFrame = CFrame.new(-660, 7.16, -889)
			end
		end
	end
end
-- yeet has been yoted
1 Like

I converted your script from client sided to serversided, this prevents exploiting to a certain extent. Your script should work now.

local seconds = 20
local player = game.Players.LocalPlayer

for i = 1, seconds do
	--FIREREMOTE -> "Starts in " .. tostring(i) .. " seconds."
	wait(1)
end

local damap = math.random(1,2)

for _, Player in pairs(game.Players:GetPlayers()) do
	if damap == 1 then

		if player.Team == game.Teams.Knight then
			print("yeet")
			player.Character.HumanoidRootPart.CFrame = CFrame.new(224, 16.5, 113)
		elseif player.Team == game.Teams.Swordsman then
			print("yeeto")
			player.Character.HumanoidRootPart.CFrame = CFrame.new(-94, 16.5, 111)
		end
	elseif damap == 2 then
		if player.Team == game.Teams.Knight then
			print("yeet")
			player.Character.HumanoidRootPart.CFrame = CFrame.new(-653, 7.16, -606)
		elseif player.Team == game.Teams.Swordsman then
			print("yeeto")
			player.Character.HumanoidRootPart.CFrame = CFrame.new(-660, 7.16, -889)
		end
	end
end
1 Like