Ummm... My "Kick or Pass" door won't work for some weird reason... Any ideas?
Asked by
5 years ago Edited 5 years ago
So, I am making a "Dev Lair", were us devs can reuse assets, control weather, etc. (I don't wanna do this via GUI). BUT, it's hidden, like so.
I am using an invisible part to either let people in or kick people. It also has a Lock feature, where I may choose to not let other devs in, either.
My code is simple and basic for any experienced dev, so here we go:
01 | local locked = script.Parent.Locked |
04 | script.parent.touched:Connect( function (t) |
06 | local plr = game.Players:GetPlayerFromCharacter(t.Parent) |
07 | local rank = plr:GetRankInGroup( 3326074 ) |
09 | if rank > = 19 and locked.Value = = false then |
10 | script.Parent.CanCollide = false |
12 | elseif rank > = 19 then |
13 | plr:Kick( "THIS HAS BEEN LOCKED BY SOME OTHER DEV (or hacker)! HA!" ) |
16 | plr:Kick( "YOU MAY NOT ENTER THE HOLY DEVELOPER'S LAR, NOOB!!! HA HA HA HA HA HA HA HA HA HA HA!!!" ) |
23 | script.Parent.TouchEnded:Connect( function () |
24 | script.Parent.CanCollide = true |
"Locked" is a Bool Value
, if you couldn't tell.
Now, if we move to the Output log, things get VERY confusing indeed...
17:14:00.903 - Workspace.Terrain.DevLair.KickWall.Script:10: attempt to index upvalue 'locked' (a boolean value)
17:14:00.904 - Stack Begin
17:14:00.904 - Script 'Workspace.Terrain.DevLair.KickWall.Script', Line 10
17:14:00.905 - Stack End
So, I ask: " WHAT IS AN "upvalue???! "
And, also, can somebody please help me figure out how to fix this? Thanks in advance!