Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Door clearance leaderstat not returning a value?

Asked by 10 years ago

I have an error at line 10, It reads:

Clearance is not a valid member of Part

Here is my code:

01moving = script.Parent.Parent.Moving
02open = script.Parent.Parent.Open
03local trigger = script.Parent
04local gate = script.Parent.Parent.Door
05 
06moving.Value = false
07open.Value = false
08 
09function onTouched(hit)
10if game.Players:GetPlayerFromCharacter(hit.Parent).leaderstats.Clearance.Value >= script.Parent.Clearance.Value then --AFFECTED LINE
11if open.Value == false and moving.Value == false then
12gate.Smoke.Enabled = true
13moving.Value = true
14script.Parent.Whoosh:Play()
15 
View all 38 lines...

WOW, IM AN IDIOT! Sorry.

Answer this question