Click Detector clicking won't work... How do I fix this?
So I have 4 parts that are inside of each other with click detectors with the activation distance of 0.
Then a user does something and activates this script.
01 | local Jobs = script.Parent.Parent.Jobs |
04 | if Card.Name = = "Card1" then |
05 | Jobs.Job 4. Transparency = 0 |
06 | Jobs.Job 4. SurfaceGui.Enabled = true |
07 | Jobs.Job 4. ClickDetector.MaxActivationDistance = 32 |
08 | script.Parent.Job.Value = 1 |
09 | Card.Parent = game.Lighting |
11 | script.Parent.Parent.Screen.SurfaceGui.CurrentJob.Text = "Mechanic (COMING SOON)" |
14 | if Card.Name = = "Card2" then |
15 | Jobs.Job 3. Transparency = 0 |
16 | Jobs.Job 3. SurfaceGui.Enabled = true |
17 | Jobs.Job 3. ClickDetector.MaxActivationDistance = 32 |
18 | script.Parent.Job.Value = 2 |
19 | Card.Parent = game.Lighting |
21 | script.Parent.Parent.Screen.SurfaceGui.CurrentJob.Text = "Gormet Chef (COMING SOON)" |
24 | if Card.Name = = "Card3" then |
25 | Jobs.Job 1. Transparency = 0 |
26 | Jobs.Job 1. SurfaceGui.Enabled = true |
27 | Jobs.Job 1. ClickDetector.MaxActivationDistance = 32 |
28 | script.Parent.Job.Value = 3 |
29 | Card.Parent = game.Lighting |
31 | script.Parent.Parent.Screen.SurfaceGui.CurrentJob.Text = "Office Worker (NOT FINISHED)" |
34 | if Card.Name = = "Card4" then |
35 | Jobs.Job 2. Transparency = 0 |
36 | Jobs.Job 2. SurfaceGui.Enabled = true |
37 | Jobs.Job 2. ClickDetector.MaxActivationDistance = 32 |
38 | script.Parent.Job.Value = 4 |
39 | Card.Parent = game.Lighting |
41 | script.Parent.Parent.Screen.SurfaceGui.CurrentJob.Text = "Store Clerk (COMING SOON)" |
44 | script.Parent.Touched:connect(Unlock) |
Accept when on of the Jobs activation distances go to 32 it won't let me click on it. Only Job1 works the rest do now. And also only one has the activation of 32 once the script is ran. Anyways to solve this?