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
01 | local didyouwin = 0 |
02 | local function CompleteTheObby() |
03 | TimerEvent:FireAllClients( 30 ) |
04 | -- TimerEvent is one of my remote functions, it sets a timer |
05 | wait( 30 ) |
06 | game.Workspace.ObbyCompleted.Touched:Connect( function (WonObby) |
07 | --invisible part gets touched when you win |
08 | didyouwin = 1 |
09 |
10 | end ) |
11 | if didyouwin = = 1 then |
12 | else |
13 | for i,v in pairs (game.Players:GetPlayers()) do |
14 | if v.Character then |
15 | v.Character.Humanoid.Health = 0 |
16 | end |
17 | end |
18 | end |
19 | end |
20 | end |
Again, when i try to call the function it says it dosent exist. please help.