• Print

Author Topic: Unexpected customCheck  (Read 3591 times)

0 Members and 1 Guest are viewing this topic.

Offline Break

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Unexpected customCheck
« on: July 12, 2017, 11:19:25 am »
So I am trying to allow only certain ranks to purchase a printer.
Code: Lua
  1. DarkRP.createEntity("Obsidian Printer", {
  2.         ent = "printer_crystal",
  3.         model = "models/props_junk/cardboard_box004a.mdl",
  4.         price = 75000,
  5.         max = 1,
  6.         cmd = "buyobsdianprinter"
  7.         customCheck = function(ply) return ply:IsUserGroup("bronzevip") end
  8. })
When I ran it through the fptje.github code viewer it came up saying there was an unexpected customCheck. I have no idea how I would fix this issue and I am hoping someone could help? :)
Thank you

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Unexpected customCheck
« Reply #1 on: July 12, 2017, 12:41:41 pm »
You forgot a comma after the line
Code: Lua
  1. cmd = "buyobsdianprinter"
  2.  
So Lua interprets it as the end of the entity with a random customCheck sitting there.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline Break

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Unexpected customCheck
« Reply #2 on: July 12, 2017, 12:58:27 pm »
That has fixed it, thank you so much!

  • Print