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:
local locked = script.Parent.Locked -- A "Bool Value"
-----------------------------------------------------------------------------------
script.parent.touched:Connect(function(t)
local plr = game.Players:GetPlayerFromCharacter(t.Parent)
local rank =plr:GetRankInGroup(3326074)
if rank >= 19 and locked.Value == false then
script.Parent.CanCollide = false
elseif rank >= 19 then
plr:Kick("THIS HAS BEEN LOCKED BY SOME OTHER DEV (or hacker)! HA!")
else
plr:Kick("YOU MAY NOT ENTER THE HOLY DEVELOPER'S LAR, NOOB!!! HA HA HA HA HA HA HA HA HA HA HA!!!")
end
end)
----------------------------------------------------------------------------------
script.Parent.TouchEnded:Connect(function()
script.Parent.CanCollide = true
end)
"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!

1 comment
I'm gonna put it as loocked. Hope that works... I do believe that will fix it though.