Hello, I am new to LUA and trying to code a simple script to prevent non admins from using a specific STOOL. I realize there is probably a better way to do this (and if you know how besides ASSMOD i would be interested… I know, wrong section, sorry) but i meant it as a learning exercise
local function WeaponEquip(wep) function checkAdmin(ply) if ply:IsAdmin() then end else if wep:GetClass() == "tool_cratemaker" then wep:Remove() Player:Give("gmod_tool"); end end hook.Add( "WeaponEquip", WeaponEquip )
I also get this error in console
autorun/test.lua:7: 'end' expected (to close 'function' at line 3) near 'else'
Any help would be appreciated