i am trying to make a part of my game with parkour but whenever i try to call the function it says the function does not exist, here is my code

local didyouwin = 0
	local function CompleteTheObby()
		TimerEvent:FireAllClients(30)
-- TimerEvent is one of my remote functions, it sets a timer
		wait(30)
		game.Workspace.ObbyCompleted.Touched:Connect(function(WonObby)
--invisible part gets touched when you win
		didyouwin =1
			
		end)
		if didyouwin ==1 then
		else
			for i,v in pairs(game.Players:GetPlayers()) do
			if v.Character then
				v.Character.Humanoid.Health = 0
					end
				end
			end
		end
end

Again, when i try to call the function it says it dosent exist. please help.

1 comment

0

Try changing the 'local function' to just 'function'