Door clearance leaderstat not returning a value?
I have an error at line 10, It reads:
Clearance is not a valid member of Part
Here is my code:
01 | moving = script.Parent.Parent.Moving |
02 | open = script.Parent.Parent.Open |
03 | local trigger = script.Parent |
04 | local gate = script.Parent.Parent.Door |
09 | function onTouched(hit) |
10 | if game.Players:GetPlayerFromCharacter(hit.Parent).leaderstats.Clearance.Value > = script.Parent.Clearance.Value then |
11 | if open.Value = = false and moving.Value = = false then |
12 | gate.Smoke.Enabled = true |
14 | script.Parent.Whoosh:Play() |
16 | for i = 1 , (gate.Size.Y * 2 + 2 ) do |
18 | gate.CFrame = gate.CFrame*CFrame.new( 0 , 0 , - 0.6 ) |
20 | gate.Smoke.Enabled = false |
24 | gate.Smoke.Enabled = true |
26 | script.Parent.Whoosh:Play() |
27 | for i = 1 , (gate.Size.Y * 2 + 2 ) do |
29 | gate.CFrame = gate.CFrame*CFrame.new( 0 , 0 , 0.6 ) |
31 | gate.Smoke.Enabled = false |
38 | script.Parent.Touched:connect(onTouched) |
WOW, IM AN IDIOT!
Sorry.