• Lock certain doorgroups on server start
    3 replies, posted
So I want to be able to lock the groups "bank" and "Police Station" after the server restarts I've tried using this in \garrysmod\lua\autorun\server\ and I get no errors but the doors are still unlocked https://files.facepunch.com/forum/upload/336042/74d4243b-600c-4efb-8fc1-c2d9ed2b778e/image.png any help would be great thanks
Let's analyze your code condition: Door is valid: Check door.getKeysDoorGroup member exists: Check door:getKeysDoorGroup is equal to table.HasValue(DoorGroup): That doesn't sound logic at all In case you don't understand what table.HasValue does, it takes 2 parameters, a table and the value you're searching on the table, it returns true or false, not an iteration from all it elements To fix it, just replace door:getKeysDoorGroup() == table.HasValue(DoorGroup) to table.HasValue(DoorGroup, door:getKeysDoorGroup())
I only have a basic knowledge of lua rip I tried replacing it with the code you gave me and there's still no errors but the doors are unlocked
DarkRP already has a command for it, its /forcelock or /forceunlock
Sorry, you need to Log In to post a reply to this thread.