Problem with part of my script

Hmm the problem is with the local script as it returns nil according to a print(diffulty)

local RemoveEvent = game.ReplicatedStorage.TimeCompletedEvent
local player = game.Players.LocalPlayer
local TimeGui = player.PlayerGui:WaitForChild("TimeGui")

local debounce = false

local function onTouched(diffulty)
	if debounce == false then
		
		local EasyText = TimeGui:WaitForChild("EasyText")
		local NormalText = TimeGui:WaitForChild("NormalText")
		local MediumText = TimeGui:WaitForChild("MediumText")
		local HardText = TimeGui:WaitForChild("HardText")
		
		local diffulty 	
		
		if EasyText.Visible == true then
			diffulty = "Easy"
		elseif NormalText.Visible == true then
			diffulty = "Normal"
		elseif MediumText.Visible == true then
			diffulty = "Medium"
		elseif HardText.Visible == true then
			diffulty = "Hard"
		end
		
		local timetext = TimeGui:WaitForChild("TimeText")
		local finishtime = timetext.Text
		
	RemoveEvent:FireServer(diffulty, finishtime)
		print(diffulty)
		wait(2)
		debounce = false
	end
end

game.Workspace.Stop.Touched:Connect(onTouched)
game.Workspace.EasyStop.Touched:Connect(onTouched)
game.Workspace.MediumStop.Touched:Connect(onTouched)
game.Workspace.HardStop.Touched:Connect(onTouched)

Oh gosh this requires some scoping then

I think to prevent the error, you could just temporary do

local diffulty = "Test"

For now?

You can also refer to this:

Hmm so it prints it as Test then prints the diffulcty after that one

Wha? Could you show a screenshot?

image
May know the issue of why it does this though

Strange, well it’s half right at least somewhat O_o