General > Developers Corner

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

(1/5) > >>

daniel507:
Hi, i have recently made a dark RP server which has ULX on. I was thinking of making a donator group which were able to see donator jobs. i have made the group called "donator" but when i start using " function(ply) return ply:IsUserGroup("donator") end)" under the jobs i want to make donator. I get a load of LUA errors and there is no jobs at all appearing.

Please check out my Shared.lua and tell me what i have done wrong.

Thanks

MrPresident:
Please tell us what errors you are getting. Also, your topic was locked. Not sure if this was an error. I'm unlocking it.

daniel507:
I can usually fix lua errors but this one doesn't make sense -

[ERROR] gamemodes/darkrp/gamemode/shared.lua:103: ')' expected (to close '(' at line 102) near '}'
  1. unknown - gamemodes/darkrp/gamemode/shared.lua:

MrPresident:
Unless I'm missing something you posted this as your code in yours first post...


--- Code: ---function(ply) return ply:IsUserGroup("donator") end)

--- End code ---


Take a look. The error says that there is an unexpected ")"

If your code you have a ")" after the end but there is no opening parenthesis anywhere in your code.


Cope line 103 exactly as you have it in your code.

I looked at your shared.lua you posted. Take out that } at the end of your function. it shouldn't be end}) .. just .. end)

Hopefully that makes sense and fixes your issue.

daniel507:
Thanks, you taught me something that will help me in the future and i thank you very much for helping me resolve this problem :D. Great Admin +1!

Navigation

[0] Message Index

[#] Next page

Go to full version