I get this error [ERROR] addons/ulx/lua/ulx/modules/sh/custom.lua:5: '<name>' expected near '('
1. unknown - addons/ulx/lua/ulx/modules/sh/custom.lua:0
randomly some times the custom ulx works and other times it chooses not to, usually after i add something but even if i remove it, it will still not work.
[CODE]CATEGORY_NAME = "Custom"
------------------------------Spam Notify -------------------------
function ulx.spamnotify(calling_ply, target_ply, amount, message)
for (i = 1, amount) do
target_ply:Notify(message, 0, 5)
end
end
local spamnotify = ulx.command(CATEGORY_NAME, "ulx spamnotify", ulx.spamnotify, "!spamnotify", true)
spamnotify:addParam{ type=ULib.cmds.PlayerArg }
spamnotify:defaultAccess(ULib.ACCESS_SUPERADMIN)
spamnotify:help("Notifys the player according to the specified amount of times.")[/CODE]
You can't wrap for loop arguments like that
[QUOTE=bigdogmat;52843056]You can't wrap for loop arguments like that[/QUOTE]
Well it works sometimes and sometimes the ULX breaks, its a ulx issue the code works fine it was working until i tried adding something to the category then i removed that thing and i still get the error.
[QUOTE=ActuallyFBI;52843058]Well it works sometimes and sometimes the ULX breaks, its a ulx issue the code works fine it was working until i tried adding something to the category then i removed that thing and i still get the error.[/QUOTE]
I don't know if you understood my post, this isn't a ulx issue, this just isn't allowed by the Lua syntax.
[QUOTE=bigdogmat;52843067]I don't know if you understood my post, this isn't a ulx issue, this just isn't allowed by the Lua syntax.[/QUOTE]
Then why was it working perfectly earlier.
[code]
for i = foo, bar do
[/code]
is completely valid
[code]
for (i = foo, bar) do
[/code]
is not and will cause a syntax error, the exact same one you're getting.
[editline]1st November 2017[/editline]
[QUOTE=ActuallyFBI;52843068]Then why was it working perfectly earlier.[/QUOTE]
Post the code where it was working then, as this will always raise a syntax error.
[QUOTE=bigdogmat;52843067]I don't know if you understood my post, this isn't a ulx issue, this just isn't allowed by the Lua syntax.[/QUOTE]
I am sorry i was being a dick, i am tired and fustrated you were correct and I have no idea why it was working fine earlier thank you.
[editline]1st November 2017[/editline]
[QUOTE=bigdogmat;52843072][code]
for i = foo, bar do
[/code]
is completely valid
[code]
for (i = foo, bar) do
[/code]
is not and will cause a syntax error, the exact same one you're getting.
[editline]1st November 2017[/editline]
Post the code where it was working then, as this will always raise a syntax error.[/QUOTE]
and its the same code, i have no idea how it was working but it was.
Sorry, you need to Log In to post a reply to this thread.