Lua error,not sure why

Getting this

[ERROR] lua/autorun/promote.lua:1: ‘=’ expected near ‘not’

  1. unknown - lua/autorun/promote.lua:0

Using this


deriif not SERVER then return end

--AutoPromote 1.0
--Automaticly promotes players to different groups based on UTime.
--By HOLOGRAPHICpizza. Released under the MIT license.

local promoteGroups = {
--	Groups must be listed in decending order.
--	["hours"] = "group",
	["3"] = "respected",
}

local excludeGroups = {
	"moderator",
	"vip",
	"admin",
	"superadmin",
	"owner"
	"donatoradmin"
}

--DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING--

--Checks if they are ready to be promoted.
function deathCheck(ply)
	if not excludeCheck(ply) then
		local newGroup = promoteCheck(ply)
		promote(ply, newGroup)
	end
end
hook.Add( "PlayerDeath", "deathCheck", deathCheck )

--Check if they are in an excluded group.
function excludeCheck(ply)
	local excluded = false
	
	for k, v in ipairs(excludeGroups) do
		if ply:IsUserGroup(v) then
			excluded = true
		end
	end
	
	return excluded
end

--Check what group they fall in.
function promoteCheck(ply)
	local hours = math.floor((ply:GetUTime() + CurTime() - ply:GetUTimeStart())/60/60)
	local newGroup = "user"
	
	for k, v in pairs(promoteGroups) do
		if hours >= tonumber(k) then
			newGroup = v
		end
	end
	
	return newGroup
end

--Promote the player to the group.
function promote(ply, newGroup)
	if not ply:IsUserGroup(newGroup) then --Make sure we don't promote them tho their current group.
		game.ConsoleCommand("ulx adduser " ..string.format("%q", ply:Nick() ).. " " ..string.format("%q", newGroup).. " 
")
	end
end

Look at the first line, deriif. Looks like you were about to put derivesomeshit, just make that ‘if’.

Thanks,ill try that

[editline]20th July 2013[/editline]

Now getting this
[ERROR] lua/autorun/promote.lua:19: ‘}’ expected (to close ‘{’ at line 13) near ‘“donatoradmin”’

  1. unknown - lua/autorun/promote.lua:0

With the same script. I dont understand because it does get closed

It’s because you’re missing a “,” after the “owner” value.

You forgot a comma after owner