Tasks not working right

Hey,

I want to make task system for my game. It worked almost right before, but now it’s almost completely broke. So now all these tasks are getting mixed up. For example, in the “Complete CitySauna 3 times” task, you have to defeat CitySauna 3 times, so every time you pass CitySauna, you get an additional value, and it even checks if it has a different Value to know which task it is. However, it gets mixed up with other tasks, like “Collect 10m SaunaCoins from any sauna,” which usually adds 50000 to that Value, but for some reason, it also adds to other tasks, such as the “Complete CitySauna 3 times” one. I’ve been constantly trying to come up with a solution, but I just can’t find one. Please feel free to ask if there’s anything puzzling in the code. The code is below. I apologize for using Finnish words in the code, as I am Finnish myself and I usually prefer using Finnish words.

I am really happy if you can solve this annoying problem.

wait(5)
local rebv = game.Players.LocalPlayer:WaitForChild("Rebirths"):FindFirstChild("Rebirth")
local main = script.Parent.bg
local nappi = script.Parent.ImageButton
local l = main.l
local r = main.r
local va = 1
local t1 = main.task1
local t2 = main.task2
local t3 = main.task3
local eteht = 1
local mteht = 1
local hteht = 1

local mlock = true
local hlock = true
local ilock = true

local tasks = main.task
local eraham = 10000000
local esauna = 3
local msauna = 10
local esauna2 = 10
local ekauppa = 5000
local vaikeus = 1
local edone = "nope"
local ts = game:GetService("TweenService")
local tehty = script.Parent.taskcomplete
local tehty2 = tehty.what
local ss = script.Parent.Sound

main.Visible = false
local s = nappi.Sound
local vaihto = 1
local auki = "rbxassetid://14846567571"
local kiinni = "rbxassetid://14846635492"

local lukossa = "rbxassetid://14925684737"
local avattu = "rbxassetid://14740281746"

local easy = "rbxassetid://14846393004"
local medium = "rbxassetid://14846682734"
local hard = "rbxassetid://14846685321"
local impossible = "rbxassetid://14846688071"

local notations = {
	{1e3,"k"},
	{1e6,"m"},
	{1e9,"b"},
	{1e12,"t"},
	{1e15,"Qa"},
	{1e18,"Qi"},
	{1e21,"Sx"},
	{1e24,"Sp"},
	{1e27,"Oc"},
	{1e30,"No"}
}

local function formatNumber(number:IntValue)
	local num_string = tostring(number)
	for notation = 1,#notations,1 do
		local min = notations[notation][1]
		local max = notations[math.clamp(notation+1,1,#notations)][1]
		if number >= min and number < max then
			local new_number = math.round((number/min)*10)/10
			num_string = tostring(new_number)
			return num_string..notations[notation][2]
		end
	end
	return num_string
end

local of = game.Players.LocalPlayer:WaitForChild("guiof"):FindFirstChild("of")
local ofee = game.ReplicatedStorage.of
of.Changed:Connect(function()
	if of == 1 then
		main.Visible = false
		wait()
		vaihto = 1
		of = 0
		
		
	end
	
end)


local coin = game.Players.LocalPlayer:WaitForChild("leaderstats"):FindFirstChild("Coins")
local crown = game.Players.LocalPlayer:WaitForChild("leaderstats"):FindFirstChild("Crowns")
local et1 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("et1")
local et2 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("et2")
local et3 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("et3")
local mt1 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("mt1")
local mt2 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("mt2")
local mt3 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("mt3")
local ht1 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("ht1")
local ht2 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("ht2")
local ht3 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("ht3")
local it1 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("it1")
local it2 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("it2")
local it3 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("it3")
local e1 = game.ReplicatedStorage:WaitForChild("tasks"):FindFirstChild("e1")
local e2 = game.ReplicatedStorage:WaitForChild("tasks"):FindFirstChild("e2")
local e3 = game.ReplicatedStorage:WaitForChild("tasks"):FindFirstChild("e3")
local m1 = game.ReplicatedStorage:WaitForChild("tasks"):FindFirstChild("m1")
local m2 = game.ReplicatedStorage:WaitForChild("tasks"):FindFirstChild("m2")
local m3 = game.ReplicatedStorage:WaitForChild("tasks"):FindFirstChild("m3")

local er = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("eraha")
local er2 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("eraha2")
local er3 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("eraha3")

local mr = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("mraha")
local mr2 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("mraha2")
local mr3 = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("mraha3")
local hr = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("hraha")
local ir = game.Players.LocalPlayer:WaitForChild("tasks"):FindFirstChild("iraha")

local eev = game.ReplicatedStorage.tasks:WaitForChild("er")
local eev2 = game.ReplicatedStorage.tasks:WaitForChild("er2")
local eev3 = game.ReplicatedStorage.tasks:WaitForChild("er3")
local mev = game.ReplicatedStorage.tasks:WaitForChild("mr")
local hev = game.ReplicatedStorage.tasks:WaitForChild("hr")
local iev = game.ReplicatedStorage.tasks:WaitForChild("ir")

local coe = game.ReplicatedStorage:WaitForChild("Coinsmuutos")
local cre = game.ReplicatedStorage:WaitForChild("kruununmuutos")


local met1 = formatNumber(et1.Value)
local met2 = formatNumber(et2.Value)
local met3 = formatNumber(et3.Value)
local mmt1 = formatNumber(mt1.Value)
local mmt2 = formatNumber(mt2.Value)
local mmt3 = formatNumber(mt3.Value)

rebv.Changed:Connect(function()
	if rebv.Value == 0 then
		nappi.Image = lukossa
	else
		nappi.Image = avattu
		if rebv.Value == 3 then
			mlock = false
		end
		if rebv.Value == 10 then
			hlock = false
		end
		if rebv.Value == 50 then
			ilock = false
		end
	end
end)
if rebv.Value == 0 then
	nappi.Image = lukossa
else
	nappi.Image = avattu
	if rebv.Value == 3 then
		mlock = false
	end
	if rebv.Value == 10 then
		hlock = false
	end
	if rebv.Value == 50 then
		ilock = false
	end
end

local function done()
	local newtehty = tehty:Clone()
	newtehty.Name = "newdone"
	newtehty.Parent = script.Parent
	newtehty.what.Text = edone


	local infoup = TweenInfo.new(
		1,
		Enum.EasingStyle.Quart,
		Enum.EasingDirection.Out,
		0,
		false,
		0
	)

	local infodown = TweenInfo.new(
		1,
		Enum.EasingStyle.Back,
		Enum.EasingDirection.In,
		0,
		false,
		0
	)
	local infoylos = ts:Create(newtehty, infoup, {Position = UDim2.new(0.345, 0, -0.142, 0)})
	local infoalas = ts:Create(newtehty, infodown, {Position = UDim2.new(0.345, 0, -0.442, 0)})
	ss:Play()
	infoylos:Play()
	wait(2)
	infoalas:Play()
	wait(1)
	newtehty:Destroy()
end


local r2 = 0
local function easyt()
	local r = math.random(1, 7)
	r2 = r
	if r == 1 then
		if eteht == 1 then
			et1.Value = 0
			e1:FireServer(et1.Value)
			t1.task.Text = "Complete CitySauna 3 times"
			t1.task2.Text = et1.Value .. "/ 3"
			t1.rewards.what.Text = "10m"
			t1.rewards.ImageLabel.Image = "rbxassetid://10965403921"
			esauna = 3
			er.Value = 2
			eev:FireServer(er.Value)
			
		elseif eteht == 2 then
			et2.Value = 0
			e2:FireServer(et2.Value)
			t2.task.Text = "Complete CitySauna 3 times"
			t2.task2.Text = et2.Value .. "/ 3"
			t2.rewards.what.Text = "10m"
			t2.rewards.ImageLabel.Image = "rbxassetid://10965403921"
			esauna = 3
			er2.Value = 2
			eev2:FireServer(er2.Value)
		else
			et3.Value = 0
			e3:FireServer(et3.Value)
			t3.task.Text = "Complete CitySauna 3 times"
			t3.task2.Text = et3.Value .. "/ 3"
			t3.rewards.what.Text = "5k"
			t3.rewards.ImageLabel.Image = "rbxassetid://14472667662"
			esauna = 3
			er3.Value = 2
			eev3:FireServer(er3.Value)
			
		end
	elseif r == 2 then
		if eteht == 1 then
			et1.Value = 0
			e1:FireServer(et1.Value)
			t1.task.Text = "Collect 10m coins from any sauna"
			met1 = formatNumber(et1.Value)
			t1.task2.Text = met1 .. "/ 10m"
			t1.rewards.what.Text = "10m"
			t1.rewards.ImageLabel.Image = "rbxassetid://10965403921"
			eraham = 10000000
			er.Value = 1
			eev:FireServer(er.Value)
		elseif eteht == 2 then
			et2.Value = 0
			e2:FireServer(et2.Value)
			t2.task.Text = "Collect 10m coins from any sauna"
			met2 = formatNumber(et2.Value)
			t2.task2.Text = met2 .. "/ 10m"
			t2.rewards.what.Text = "10m"
			t2.rewards.ImageLabel.Image = "rbxassetid://10965403921"
			eraham = 10000000
			er2.Value = 1
			eev2:FireServer(er2.Value)
		else
			et3.Value = 0
			e3:FireServer(et3.Value)
			t3.task.Text = "Collect 10m coins from any sauna"
			met3 = formatNumber(et3.Value)
			t3.task2.Text = met3 .. "/ 10m"
			t3.rewards.what.Text = "5k"
			t3.rewards.ImageLabel.Image = "rbxassetid://14472667662"
			eraham = 10000000
			er3.Value = 1
			eev3:FireServer(er3.Value)
		end
		
	elseif r == 3 then
		if eteht == 1 then
			et1.Value = 0
			t1.task.Text = "Complete ModernSauna 3 times"
			t1.task2.Text = et1.Value .. "/ 3"
			t1.rewards.what.Text = "10m"
			t1.rewards.ImageLabel.Image = "rbxassetid://10965403921"
			esauna = 3
			er.Value = 3
			eev:FireServer(er.Value)
		elseif eteht == 2 then
			et2.Value = 0
			t2.task.Text = "Complete ModernSauna 3 times"
			t2.task2.Text = et2.Value .. "/ 3"
			t2.rewards.what.Text = "10m"
			t2.rewards.ImageLabel.Image = "rbxassetid://10965403921"
			esauna = 3
			er2.Value = 3
			eev2:FireServer(er2.Value)
		else
			et3.Value = 0
			t3.task.Text = "Complete ModernSauna 3 times"
			t3.task2.Text = et3.Value .. "/ 3"
			t3.rewards.what.Text = "5k"
			t3.rewards.ImageLabel.Image = "rbxassetid://14472667662"
			esauna = 3
			er3.Value = 3
			eev3:FireServer(er3.Value)

		end
	elseif r == 4 then
		if eteht == 1 then
			et1.Value = 0
			t1.task.Text = 'Get 1 "Nut"-Title from TT-Wheel'
			t1.task2.Text = et1.Value .. "/ 1"
			t1.rewards.what.Text = "10m"
			t1.rewards.ImageLabel.Image = "rbxassetid://10965403921"
			esauna = 3
			er.Value = 4
			eev:FireServer(er.Value)
		elseif eteht == 2 then
			et2.Value = 0
			t2.task.Text = 'Get 1 "Nut"-Title from TT-Wheel'
			t2.task2.Text = et2.Value .. "/ 1"
			t2.rewards.what.Text = "10m"
			t2.rewards.ImageLabel.Image = "rbxassetid://10965403921"
			esauna = 3
			er2.Value = 4
			eev2:FireServer(er2.Value)
		else
			et3.Value = 0
			t3.task.Text = 'Get 1 "Nut"-Title from TT-Wheel'
			t3.task2.Text = et3.Value .. "/ 1"
			t3.rewards.what.Text = "5k"
			t3.rewards.ImageLabel.Image = "rbxassetid://14472667662"
			esauna = 3
			er3.Value = 4
			eev3:FireServer(er3.Value)

		end
	elseif r == 5 then
		if eteht == 1 then
			et1.Value = 0
			t1.task.Text = 'Get 1 "Helper"-Title from TT-Wheel'
			t1.task2.Text = et1.Value .. "/ 1"
			t1.rewards.what.Text = "10m"
			t1.rewards.ImageLabel.Image = "rbxassetid://10965403921"
			esauna = 3
			er.Value = 5
			eev:FireServer(er.Value)
		elseif eteht == 2 then
			et2.Value = 0
			t2.task.Text = 'Get 1 "Helper"-Title from TT-Wheel'
			t2.task2.Text = et2.Value .. "/ 1"
			t2.rewards.what.Text = "10m"
			t2.rewards.ImageLabel.Image = "rbxassetid://10965403921"
			esauna = 3
			er2.Value = 5
			eev2:FireServer(er2.Value)
		else
			et3.Value = 0
			t3.task.Text = 'Get 1 "Helper"-Title from TT-Wheel'
			t3.task2.Text = et3.Value .. "/ 1"
			t3.rewards.what.Text = "5k"
			t3.rewards.ImageLabel.Image = "rbxassetid://14472667662"
			esauna = 3
			er3.Value = 5
			eev3:FireServer(er3.Value)

		end
	elseif r == 6 then
		if eteht == 1 then
			et1.Value = 0
			t1.task.Text = 'Claim DailyKiulu 3 times'
			t1.task2.Text = et1.Value .. "/ 3"
			t1.rewards.what.Text = "10m"
			t1.rewards.ImageLabel.Image = "rbxassetid://10965403921"
			esauna = 3
			er.Value = 6
			eev:FireServer(er.Value)
		elseif eteht == 2 then
			et2.Value = 0
			t2.task.Text = 'Claim DailyKiulu 3 times'
			t2.task2.Text = et2.Value .. "/ 3"
			t2.rewards.what.Text = "10m"
			t2.rewards.ImageLabel.Image = "rbxassetid://10965403921"
			esauna = 3
			er2.Value = 6
			eev2:FireServer(er2.Value)
		else
			et3.Value = 0
			t3.task.Text = 'Claim DailyKiulu 3 times'
			t3.task2.Text = et3.Value .. "/ 3"
			t3.rewards.what.Text = "5k"
			t3.rewards.ImageLabel.Image = "rbxassetid://14472667662"
			esauna = 3
			er3.Value = 6
			eev3:FireServer(er3.Value)

		end
	else
		if eteht == 1 then
			et1.Value = 0
			t1.task.Text = 'Buy 5k Crowns from the shop using Gems'
			met1 = formatNumber(et1.Value)
			t1.task2.Text = met1 .. "/ 5k"
			t1.rewards.what.Text = "10m"
			t1.rewards.ImageLabel.Image = "rbxassetid://10965403921"
			esauna = 3
			er.Value = 7
			eev:FireServer(er.Value)
		elseif eteht == 2 then
			et2.Value = 0
			t2.task.Text = 'Buy 5k Crowns from the shop using Gems'
			met2 = formatNumber(et2.Value)
			t2.task2.Text = met2 .. "/ 5k"
			t2.rewards.what.Text = "10m"
			t2.rewards.ImageLabel.Image = "rbxassetid://10965403921"
			esauna = 3
			er2.Value = 7
			eev2:FireServer(er2.Value)
		else
			et3.Value = 0
			t3.task.Text = 'Buy 5k Crowns from the shop using Gems'
			met3 = formatNumber(et3.Value)
			t3.task2.Text = met3 .. "/ 5k"
			t3.rewards.what.Text = "5k"
			t3.rewards.ImageLabel.Image = "rbxassetid://14472667662"
			esauna = 3
			er3.Value = 7
			eev3:FireServer(er3.Value)

		end

	end
end

local function checktasks()
	
	if et1.Value >= 0 and er.Value == 2 then
		met1 = formatNumber(et1.Value)
		t1.task.Text = "Complete CitySauna 3 times"
		t1.task2.Text = et1.Value .. "/ 3"
		t1.rewards.what.Text = "10m"
		t1.rewards.ImageLabel.Image = "rbxassetid://10965403921"
	elseif et1.Value >= 0 and er.Value == 1 then
		t1.task.Text = "Collect 10m coins from any sauna"
		met1 = formatNumber(et1.Value)
		t1.task2.Text = met1 .. "/ 10m"
		t1.rewards.what.Text = "10m"
		t1.rewards.ImageLabel.Image = "rbxassetid://10965403921"
		
		
	elseif et1.Value >= 0 and er.Value == 3 then
		t1.task.Text = "Complete ModernSauna 3 times"
		t1.task2.Text = et1.Value .. "/ 3"
		t1.rewards.what.Text = "10m"
		
		t1.rewards.ImageLabel.Image = "rbxassetid://10965403921"
	elseif et1.Value >= 0 and er.Value == 4 then
		t1.task.Text = 'Get 1 "Nut"-Title from TT-Wheel'
		t1.task2.Text = et1.Value .. "/ 1"
		t1.rewards.what.Text = "10m"
		t1.rewards.ImageLabel.Image = "rbxassetid://10965403921"
	elseif et1.Value >= 0 and er.Value == 5 then
		t1.task.Text = 'Get 1 "Helper"-Title from TT-Wheel'
		t1.task2.Text = et1.Value .. "/ 1"
		t1.rewards.what.Text = "10m"
		t1.rewards.ImageLabel.Image = "rbxassetid://10965403921"
	elseif et1.Value >= 0 and er.Value == 6 then
		t1.task.Text = 'Claim DailyKiulu 3 times'
		t1.task2.Text = et1.Value .. "/ 3"
		t1.rewards.what.Text = "10m"
		t1.rewards.ImageLabel.Image = "rbxassetid://10965403921"
	elseif et1.Value >= 0 and er.Value == 7 then
		t1.task.Text = 'Buy 5k Crowns from the shop using Gems'
		met1 = formatNumber(et1.Value)
		t1.task2.Text = met1 .. "/ 5k"
		t1.rewards.what.Text = "10m"
		t1.rewards.ImageLabel.Image = "rbxassetid://10965403921"
	elseif er.Value == 0 then
		t1.task2.Text = "x"
	end

	if et2.Value >= 0 and er2.Value == 2 then
		t2.task.Text = "Complete CitySauna 3 times"
		t2.task2.Text = et2.Value .. "/ 3"
		t2.rewards.what.Text = "10m"
		t2.rewards.ImageLabel.Image = "rbxassetid://10965403921"
	elseif et2.Value >= 0 and er2.Value == 1 then
		t2.task.Text = "Collect 10m coins from any sauna"
		met2 = formatNumber(et2.Value)
		t2.task2.Text = met2 .. "/ 10m"
		t2.rewards.what.Text = "10m"
		t2.rewards.ImageLabel.Image = "rbxassetid://10965403921"
	elseif et2.Value >= 0 and er2.Value == 3 then
		met2 = formatNumber(et2.Value)
		t2.task.Text = "Complete ModernSauna 3 times"
		t2.task2.Text = et2.Value .. "/ 3"
		t2.rewards.what.Text = "10m"
		t2.rewards.ImageLabel.Image = "rbxassetid://10965403921"
		t2.task2.Text = met2 .. "/ 3"
	elseif et2.Value >= 0 and er2.Value == 4 then
		t2.task.Text = 'Get 1 "Nut"-Title from TT-Wheel'
		t2.task2.Text = et2.Value .. "/ 1"
		t2.rewards.what.Text = "10m"
		t2.rewards.ImageLabel.Image = "rbxassetid://10965403921"
	elseif et2.Value >= 0 and er2.Value == 5 then
		t2.task.Text = 'Get 1 "Helper"-Title from TT-Wheel'
		t2.task2.Text = et2.Value .. "/ 1"
		t2.rewards.what.Text = "10m"
		t2.rewards.ImageLabel.Image = "rbxassetid://10965403921"
	elseif et2.Value >= 0 and er2.Value == 7 then
		t2.task.Text = 'Claim DailyKiulu 3 times'
		t2.task2.Text = et2.Value .. "/ 3"
		t2.rewards.what.Text = "10m"
		t2.rewards.ImageLabel.Image = "rbxassetid://10965403921"
	elseif et2.Value >= 0 and er2.Value == 8 then
		t2.task.Text = 'Buy 5k Crowns from the shop using Gems'
		met2 = formatNumber(et2.Value)
		t2.task2.Text = met2 .. "/ 5k"
		t2.rewards.what.Text = "10m"
		t2.rewards.ImageLabel.Image = "rbxassetid://10965403921"
	elseif er2.Value == 0 then
		t2.task2.Text = "x"
	end

	if et3.Value >= 0 and er3.Value == 2 then
		t3.task.Text = "Complete CitySauna 3 times"
		t3.task2.Text = et3.Value .. "/ 3"
		t3.rewards.what.Text = "5k"
		t3.rewards.ImageLabel.Image = "rbxassetid://14472667662"
	elseif et3.Value >= 0 and er3.Value == 1 then
		t3.task.Text = "Collect 10m coins from any sauna"
		met3 = formatNumber(et3.Value)
		t3.task2.Text = met3 .. "/ 10m"
		t3.rewards.what.Text = "5k"
		t3.rewards.ImageLabel.Image = "rbxassetid://14472667662"
	elseif et3.Value >= 0 and er3.Value == 3 then
		t3.task.Text = "Complete ModernSauna 3 times"
		t3.task2.Text = et3.Value .. "/ 3"
		t3.rewards.what.Text = "5k"
		t3.rewards.ImageLabel.Image = "rbxassetid://14472667662"
	elseif et3.Value >= 0 and er3.Value == 4 then
		t3.task.Text = 'Get 1 "Nut"-Title from TT-Wheel'
		t3.task2.Text = et3.Value .. "/ 1"
		t3.rewards.what.Text = "5k"
		t3.rewards.ImageLabel.Image = "rbxassetid://14472667662"
	elseif et3.Value >= 0 and er3.Value == 5 then
		t3.task.Text = 'Get 1 "Helper"-Title from TT-Wheel'
		t3.task2.Text = et3.Value .. "/ 1"
		t3.rewards.what.Text = "5k"
		t3.rewards.ImageLabel.Image = "rbxassetid://14472667662"
	elseif et3.Value >= 0 and er3.Value == 6 then
		t3.task.Text = 'Claim DailyKiulu 3 times'
		t3.task2.Text = et3.Value .. "/ 3"
		t3.rewards.what.Text = "5k"
		t3.rewards.ImageLabel.Image = "rbxassetid://14472667662"
	elseif et3.Value >= 0 and er3.Value == 7 then
		t3.task.Text = 'Buy 5k Crowns from the shop using Gems'
		met3 = formatNumber(et3.Value)
		t3.task2.Text = met3 .. "/ 5k"
		t3.rewards.what.Text = "5k"
		t3.rewards.ImageLabel.Image = "rbxassetid://14472667662"
	elseif er3.Value == 0 then
		t3.task2.Text = "x"
	end
end


spawn(checktasks)
print("EEEEEEEEEEEEED")


nappi.MouseButton1Click:Connect(function()
	if vaihto == 1 then
		of.Value = 1
		ofee:FireServer(of)
		main.Visible = true
		s:Play()
		vaihto = 2
		
	else
		main.Visible = false
		s:Play()
		vaihto = 1
	end
end)

l.MouseButton1Click:Connect(function()
	s:Play()
	if va == 2 then
		l.Visible = false
		r.Visible = true
		t1.BackgroundColor3 = Color3.fromRGB(0, 107, 68)
		t2.BackgroundColor3 = Color3.fromRGB(0, 107, 68)
		t3.BackgroundColor3 = Color3.fromRGB(0, 107, 68)
		main.Image = easy
		tasks.Text = "Easy Tasks"
		spawn(checktasks)
		va = 1
	elseif va == 3 then
		main.Image = medium
		t1.BackgroundColor3 = Color3.fromRGB(157, 65, 0)
		t2.BackgroundColor3 = Color3.fromRGB(157, 65, 0)
		t3.BackgroundColor3 = Color3.fromRGB(157, 65, 0)
		r.Visible = true
		tasks.Text = "Medium Tasks"
		va = 2
	else
		main.Image = hard
		t1.BackgroundColor3 = Color3.fromRGB(157, 0, 3)
		t2.BackgroundColor3 = Color3.fromRGB(157, 0, 3)
		t3.BackgroundColor3 = Color3.fromRGB(157, 0, 3)
		r.Visible = true
		tasks.Text = "Hard Tasks"
 		va = 3
	end
end)

r.MouseButton1Click:Connect(function()
	s:Play()
	if va == 1 then
		if mlock == false then


			va = 2
			main.Image = medium
			t1.BackgroundColor3 = Color3.fromRGB(157, 65, 0)
			t2.BackgroundColor3 = Color3.fromRGB(157, 65, 0)
			t3.BackgroundColor3 = Color3.fromRGB(157, 65, 0)
			l.Visible = true
			tasks.Text = "Medium Tasks"
		end

	elseif va == 2 then
		if hlock == false then
		main.Image = hard
		t1.BackgroundColor3 = Color3.fromRGB(157, 0, 3)
		t2.BackgroundColor3 = Color3.fromRGB(157, 0, 3)
		t3.BackgroundColor3 = Color3.fromRGB(157, 0, 3)
		l.Visible = true
		va = 3
		tasks.Text = "Hard Tasks"
		end
	else
		if ilock == false then
		main.Image = impossible  
		t1.BackgroundColor3 = Color3.fromRGB(81, 0, 179)
		t2.BackgroundColor3 = Color3.fromRGB(81, 0, 179)
		t3.BackgroundColor3 = Color3.fromRGB(81, 0, 179)
		l.Visible = true
		r.Visible = false
		tasks.Text = "Impossible Tasks"
		va = 4
		end
	end
end)



et1.Changed:Connect(function()
	wait(.5)
	if er.Value == 1 then
		if et1.Value >= eraham then
			coin.Value = coin.Value + 10000000
			coe:FireServer(coin.Value)
			eteht = 1
			er.Value = 0
			et1.Value = 0
			wait()
			edone = "Collect 10m coins from any sauna"
			done()
			t1.task2.Text = "x"
		else
			met1 = formatNumber(et1.Value)
			t1.task2.Text = met1 .. "/ 10m"
			
		end
	elseif er.Value == 2 then
		if et1.Value >= esauna then
			coin.Value = coin.Value + 10000000
			coe:FireServer(coin.Value)
			eteht = 1
			er.Value = 0
			et1.Value = 0
			wait()
			edone = "Complete CitySauna 3 times"
			done()
			t1.task2.Text = "x"
		else
			met1 = formatNumber(et1.Value)
			t1.task2.Text = met1 .. "/ 3"
		end
	elseif er.Value == 3 then
		if et1.Value >= esauna then
			coin.Value = coin.Value + 10000000
			coe:FireServer(coin.Value)
			eteht = 1
			er.Value = 0
			et1.Value = 0
			wait()
			edone = "Complete ModernSauna 3 times"
			done()
			t1.task2.Text = "x"
		else
			met1 = formatNumber(et1.Value)
			t1.task2.Text = met1 .. "/ 3"
		end
	elseif er.Value == 4 then
		if et1.Value >= 1 then
			coin.Value = coin.Value + 10000000
			coe:FireServer(coin.Value)
			eteht = 1
			er.Value = 0
			et1.Value = 0
			wait()
			edone = 'Get 1 "Nut"-Title from TT-Wheel'
			done()
			t1.task2.Text = "x"
		else
			met1 = formatNumber(et1.Value)
			t1.task2.Text = met1 .. "/ 1"
		end
	elseif er.Value == 5 then
		if et1.Value >= 1 then
			coin.Value = coin.Value + 10000000
			coe:FireServer(coin.Value)
			eteht = 1
			er.Value = 0
			et1.Value = 0
			wait()
			edone = 'Get 1 "Helper"-Title from TT-Wheel'
			done()
			t1.task2.Text = "x"
		else
			met1 = formatNumber(et1.Value)
			t1.task2.Text = met1 .. "/ 1"
		end
	elseif er.Value == 6 then
		if et1.Value >= 3 then
			coin.Value = coin.Value + 10000000
			coe:FireServer(coin.Value)
			eteht = 1
			er.Value = 0
			et1.Value = 0
			wait()
			edone = 'Claim DailyKiulu 3 times'
			done()
			t1.task2.Text = "x"
		else
			met1 = formatNumber(et1.Value)
			t1.task2.Text = met1 .. "/ 3"
		end
	elseif er.Value == 7 then
		if et1.Value >= ekauppa then
			coin.Value = coin.Value + 10000000
			coe:FireServer(coin.Value)
			eteht = 1
			er.Value = 0
			et1.Value = 0
			wait()
			edone = 'Buy 5k Crowns from the shop using Gems'
			done()
			t1.task2.Text = "x"
		else
			met1 = formatNumber(et1.Value)
			t1.task2.Text = met1 .. "/ 5k"
		end
	end
end)

et2.Changed:Connect(function()
	wait(.5)
	if er2.Value == 1 then
		if et2.Value >= eraham then
			coin.Value = coin.Value + 10000000
			coe:FireServer(coin.Value)
			eteht = 2
			er2.Value = 0
			et2.Value = 0
			wait()
			edone = "Collect 10m coins from any sauna"
			done()
			t2.task2.Text = "x"
		else
			met2 = formatNumber(et2.Value)
			t2.task2.Text = met2 .. "/ 10m"
		end
	elseif er2.Value == 2 then
		if et2.Value >= esauna then
			coin.Value = coin.Value + 10000000
			coe:FireServer(coin.Value)
			eteht = 2
			er2.Value = 0
			et2.Value = 0
			wait()
			edone = "Complete CitySauna 3 times"
			done()
			t2.task2.Text = "x"
		else
			met2 = formatNumber(et2.Value)
			t2.task2.Text = met2 .. "/ 3"
			
		end
	elseif er2.Value == 3 then
		if et2.Value >= esauna then
			coin.Value = coin.Value + 10000000
			coe:FireServer(coin.Value)
			eteht = 2
			er2.Value = 0
			et2.Value = 0
			wait()
			edone = "Complete ModernSauna 3 times"
			done()
			t2.task2.Text = "x"
		else
			met2 = formatNumber(et2.Value)
			t2.task2.Text = met2 .. "/ 3"
		end
	elseif er2.Value == 4 then
		if et2.Value >= 1 then
			coin.Value = coin.Value + 10000000
			coe:FireServer(coin.Value)
			eteht = 2
			er2.Value = 0
			et2.Value = 0
			wait()
			edone = 'Get 1 "Nut"-Title from TT-Wheel'
			done()
			t2.task2.Text = "x"
		else
			met2 = formatNumber(et2.Value)
			t2.task2.Text = met2 .. "/ 1"
		end
	elseif er2.Value == 5 then
		if et2.Value >= 1 then
			coin.Value = coin.Value + 10000000
			coe:FireServer(coin.Value)
			eteht = 2
			er2.Value = 0
			et2.Value = 0
			wait()
			edone = 'Get 1 "Helper"-Title from TT-Wheel'
			done()
			t2.task2.Text = "x"
		else
			met2 = formatNumber(et2.Value)
			t2.task2.Text = met2 .. "/ 1"
		end
	elseif er2.Value == 6 then
		if et2.Value >= 3 then
			coin.Value = coin.Value + 10000000
			coe:FireServer(coin.Value)
			eteht = 2
			er2.Value = 0
			et2.Value = 0
			wait()
			edone = 'Claim DailyKiulu 3 times'
			done()
			t2.task2.Text = "x"
		else
			met2 = formatNumber(et2.Value)
			t2.task2.Text = met2 .. "/ 3"
		end
	elseif er2.Value == 7 then
		if et2.Value >= ekauppa then
			coin.Value = coin.Value + 10000000
			coe:FireServer(coin.Value)
			eteht = 2
			er2.Value = 0
			et2.Value = 0
			wait()
			edone = 'Buy 5k Crowns from the shop using Gems'
			done()
			t2.task2.Text = "x"
		else
			met2 = formatNumber(et2.Value)
			t2.task2.Text = met2 .. "/ 5k"
		end
	end
end)

et3.Changed:Connect(function()
	wait(.5)
	if er3.Value == 1 then
		if et3.Value >= eraham then
			crown.Value = crown.Value + 5000
			cre:FireServer(crown.Value)
			eteht = 3
			er3.Value = 0
			et3.Value = 0
			wait()
			edone = "Collect 10m coins from any sauna"
			done()
			t3.task2.Text = "x"
		else
			met3 = formatNumber(et3.Value)
			t3.task2.Text = met3 .. "/ 10m"
		end
	elseif er3.Value == 2 then
		if et3.Value >= esauna then
			crown.Value = crown.Value + 5000
			cre:FireServer(crown.Value)
			eteht = 3
			et2.Value = 0
			er3.Value = 0
			wait()
			edone = "Complete CitySauna 3 times"
			done()
			t3.task2.Text = "x"
		else
			met3 = formatNumber(et3.Value)
			t3.task2.Text = met3 .. "/ 3"
		end
	elseif er3.Value == 3 then
		if et3.Value >= esauna then
			crown.Value = crown.Value + 5000
			cre:FireServer(crown.Value)
			eteht = 3
			et2.Value = 0
			er3.Value = 0
			wait()
			edone = "Complete ModernSauna 3 times"
			done()
			t3.task2.Text = "x"
		else
			met3 = formatNumber(et3.Value)
			t3.task2.Text = met3 .. "/ 3"
		end
	elseif er3.Value == 4 then
		if et3.Value >= 1 then
			crown.Value = crown.Value + 5000
			cre:FireServer(crown.Value)
			eteht = 3
			et2.Value = 0
			er3.Value = 0
			wait()
			edone = 'Get 1 "Nut"-Title from TT-Wheel'
			done()
			t3.task2.Text = "x"
		else
			met3 = formatNumber(et3.Value)
			t3.task2.Text = met3 .. "/ 1"
		end
	elseif er3.Value == 5 then
		if et3.Value >= 1 then
			crown.Value = crown.Value + 5000
			cre:FireServer(crown.Value)
			eteht = 3
			et2.Value = 0
			er3.Value = 0
			wait()
			edone = 'Get 1 "Helper"-Title from TT-Wheel'
			done()
			t3.task2.Text = "x"
		else
			met3 = formatNumber(et3.Value)
			t3.task2.Text = met3 .. "/ 1"
		end
	elseif er3.Value == 6 then
		if et3.Value >= 3 then
			crown.Value = crown.Value + 5000
			cre:FireServer(crown.Value)
			eteht = 3
			et2.Value = 0
			er3.Value = 0
			wait()
			edone = 'Claim DailyKiulu 3 times'
			done()
			t3.task2.Text = "x"
		else
			met3 = formatNumber(et3.Value)
			t3.task2.Text = met3 .. "/ 3"
		end
	elseif er3.Value == 7 then
		if et3.Value >= ekauppa then
			crown.Value = crown.Value + 5000
			cre:FireServer(crown.Value)
			eteht = 3
			et2.Value = 0
			er3.Value = 0
			wait()
			edone = 'Buy 5k Crowns from the shop using Gems'
			done()
			t3.task2.Text = "x"
		else
			met3 = formatNumber(et3.Value)
			t3.task2.Text = met3 .. "/ 5k"
		end
	end
end)



while true do
	

	if t1.task2.Text == "x" then
		if vaikeus == 1 then
			eteht = 1
			easyt()
			
		end
	end
	wait(.5)
	if t2.task2.Text == "x" then
		if vaikeus == 1 then
			eteht = 2
			easyt()

		end
	end
	
	wait(.5)
	if t3.task2.Text == "x" then
		if vaikeus == 1 then
			eteht = 3
			easyt()

		end
	end
	if mlock == true then
		r.Image = kiinni
	else
		r.Image = auki
	end
	if hlock == true then
		r.Image = kiinni
	else
		r.Image = auki
	end
	if hlock == true then
		r.Image = kiinni
	else
		r.Image = auki
	end
end



Here is also one piece of that citysauna’s code:

nappi.MouseButton1Click:Connect(function()
	nappi.Visible = false -- Piilota nappi
	einappi.Visible = false -- Piilota nappi
	local player = game.Players.LocalPlayer
	local leaderstats = player:WaitForChild("leaderstats")
	local coins = leaderstats:FindFirstChild("Coins")
	local coinv = player:WaitForChild("uplvl"):WaitForChild("coinup")
	

	-- Tarkista, että leaderstats-folder ja Coins IntValue ovat olemassa


	if napinmaara >= maali then
		local plr = game.Players.LocalPlayer
		local character = plr.Character
		nappi.Visible = false -- Piilota napit
		print("VOITIT PELIN!")
		voitto.Enabled = true
		napinmaara = 1
		palkinto = 4500
		aika = 5
		ekstra = palkinto + 4500
		napinmaara2 = 70
		
		if leaderstats and coins then
			local crowns = leaderstats:FindFirstChild("Crowns")
			crowns.Value = crowns.Value + voittoo -- Lisää palkinto kolikoiden määrään
			local remoteEvent = game.ReplicatedStorage:WaitForChild("Crownsmuutos6") -- Haetaan RemoteEvent
			remoteEvent:FireServer(crowns.Value) -- Lähetetään Coins-määrä RemoteEventin kautta
			if er.Value == 2 then
				et1.Value = et1.Value + 1
				e1:FireServer(et1.Value) 
			end
			if er2.Value == 2 then
				et2.Value = et2.Value + 1
				e2:FireServer(et2.Value)
			end
			if er3.Value == 2 then
				et3.Value = et3.Value + 1
				e3:FireServer(et3.Value)
			end

		end
		anim1:Stop()
		anim2:Play()
		wait(.5)
		anim2:Stop()
		anim3:Play()
	else

		if leaderstats and coins then
			coins.Value = coins.Value + palkinto -- Lisää palkinto kolikoiden määrään
			-- Päivitä palkinnon määrä nappien mukaan
			palkinto = palkinto + 500
			if coinv.Value == 1 then
				coins.Value = coins.Value + 1000
			elseif coinv.Value == 2 then
				coins.Value = coins.Value + 20000
			elseif coinv.Value == 3 then
				coins.Value = coins.Value + 55000
			elseif coinv.Value == 4 then
				coins.Value = coins.Value + 500000
			else
				print("d")
			end
		end
		local remoteEvent = game.ReplicatedStorage:WaitForChild("Coinsmuutos5") -- Haetaan RemoteEvent
		remoteEvent:FireServer(coins.Value) -- Lähetetään Coins-määrä RemoteEventin kautta
		if coinv.Value == 1 then
			eeee = palkinto + 1000
		elseif coinv.Value == 2 then
			eeee = palkinto + 20000
		elseif coinv.Value == 3 then
			eeee = palkinto + 55000
		elseif coinv.Value == 4 then
			eeee = palkinto + 500000
		else
			eeee = palkinto
		end
		if er.Value == 1 then
			et1.Value = et1.Value + eeee
			e1:FireServer(et1.Value) 
		end
		if er2.Value == 1 then
			et2.Value = et2.Value + eeee
			e2:FireServer(et2.Value)
		end
		if er3.Value == 1 then
			et3.Value = et3.Value + eeee
			e3:FireServer(et3.Value)
		end

		napinmaara2 = napinmaara2 - 1
		-- Päivitä tekstikenttä
		napinlaskijaa.Text = "Buttons left: " .. tostring(napinmaara2)
		wait(.2) -- Odota yksi sekunti
		if istuminen == true then
			napinilmestyminen() -- Päivitä napin sijainti
			nappi.Visible = true -- Näytä nappi uudessa positionissa
			print("Nappia klikattu!")
			aika = aika - ajanpoisto --lyhentää seuraavan napin aikaa
			aika2 = aika
			napinmaara = napinmaara + 1
		else
			local plr = game.Players.LocalPlayer
			local character = plr.Character
			local humanoid = character:FindFirstChildOfClass("Humanoid")
			humanoid:LoadAnimation(animation):Stop()
			humanoid:LoadAnimation(animation2):Stop()
			humanoid:LoadAnimation(animation3):Stop()
		end

	end

	-- Tulosta viesti konsoliin, kun nappia klikataan
	-- Lisää tässä palkinnon käsittely tai muut toivotut toiminnot
end)