General > Developers Corner

Lua errors after using function(ply) return ply:IsUserGroup("donator") end)

<< < (3/5) > >>

daniel507:
i did, i downloaded your file and put it straight into server. Strangely it was the same size though? I didn't get that error before so that has to be your new modded one

MrPresident:
Right.. but your error code says:

--- Code: ---[ERROR] gamemodes/darkrp/gamemode/shared.lua:117: attempt to call method 'IsUserGroup' (a nil value)
--- End code ---

But in the file I sent you, line 117 is:

--- Code: ---If you are caught, run and don't gun your way out.]], {"lockpick"}, "thief", 3, 90, 0, false, false)
--- End code ---

daniel507:
Yep, your right but sometimes lua scripts are creating  errors and they don't know exactly where its from, so i says roughly line 117. Which i have experienced before.

daniel507:
BTW it is definitely you shared.lua i even opened it up with notepad+ and i have seen what you have done which is brilliant but seems to have a weird error.

MrPresident:
There has to be something messing up in your code.

I ran this on myself in a listen server with allowcslua turned on:


--- Code: ---] lua_run_cl print(LocalPlayer():IsUserGroup("user") or LocalPlayer():IsAdmin())
--- End code ---


and it returned true, not an error.

I don't like how DarkRP does the class setups. The code is almost impossible to read. There might be something throwing an error somewhere else in the code and its not terminating until line 117.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version