• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help Me Fix This Script

Nux

Yzeria Custom War
Joined
Jan 2, 2009
Messages
1,067
Reaction score
1
Well Here is the script

PHP:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)

	local broadcast = {3,6,9,12,15,18,21}

	if isPlayer(mostDamageKiller) == TRUE then
		db.executeQuery("UPDATE `players` SET `points` = `points` + 1 WHERE `name` = '"..getCreatureName(lmostDamageKiller).."';")
		local result = db.getResult("SELECT `points` FROM `players` WHERE `name` = '"..getCreatureName(mostDamageKiller).."';")
		if isInArray((result:getID(),braodcast) == TRUE then
			id = result:getDataInt("points")
			doBroadcastMessage(""..getCreatureName(mostDamageKiller).." has "..id.." Points!", 1)
		end
	end
	if isPlayer(lastHitKiller) == TRUE and lastHitKiller ~= mostDamageKiller then
		db.executeQuery("UPDATE `players` SET `points` = `points` + 1 WHERE `name` = '"..getCreatureName(mostDamageKiller).."';")
		local result = db.getResult("SELECT `points` FROM `players` WHERE `name` = '"..getCreatureName(lastHitKiller).."';")
		if isInArray((result:getID(),braodcast) == TRUE then
			id = result:getDataInt("points")
			doBroadcastMessage(""..getCreatureName(lastHitKiller).." has "..id.." Points!", 1)
		end	
	end
	return TRUE
end

And this is the error

[Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/kill.lua)
data/creaturescripts/scripts/kill.lua:8: ')' expected near ','
 
PHP:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)

    local broadcast = {3,6,9,12,15,18,21}

    if isPlayer(mostDamageKiller) == TRUE then
        db.executeQuery("UPDATE `players` SET `points` = `points` + 1 WHERE `name` = '"..getCreatureName(lmostDamageKiller).."';")
        local result = db.getResult("SELECT `points` FROM `players` WHERE `name` = '"..getCreatureName(mostDamageKiller).."';")
        if isInArray((result:getID(),braodcast) == TRUE then
            id = result:getDataInt("points")
            doBroadcastMessage(""..getCreatureName(mostDamageKiller).." has "..id.." Points!", 1)
        end
    end
    if isPlayer(lastHitKiller) == TRUE and lastHitKiller ~= mostDamageKiller then
        db.executeQuery("UPDATE `players` SET `points` = `points` + 1 WHERE `name` = '"..getCreatureName(mostDamageKiller).."';")
        local result = db.getResult("SELECT `points` FROM `players` WHERE `name` = '"..getCreatureName(lastHitKiller).."';")
        if isInArray(result:getID(),braodcast) == TRUE then
            id = result:getDataInt("points")
            doBroadcastMessage(""..getCreatureName(lastHitKiller).." has "..id.." Points!", 1)
        end    
    end
    return TRUE
end
 
@ Nux


Lua:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)

    local broadcast = {3,6,9,12,15,18,21}

    if isPlayer(mostDamageKiller) == TRUE then
        db.executeQuery("UPDATE `players` SET `points` = `points` + 1 WHERE `name` = '"..getCreatureName(lmostDamageKiller).."';")
        local result = db.getResult("SELECT `points` FROM `players` WHERE `name` = '"..getCreatureName(mostDamageKiller).."';")
        if isInArray((result:getID(braodcast))) == TRUE then
            id = result:getDataInt("points")
            doBroadcastMessage(""..getCreatureName(mostDamageKiller).." has "..id.." Points!", 1)
        end
    end
    if isPlayer(lastHitKiller) == TRUE and lastHitKiller ~= mostDamageKiller then
        db.executeQuery("UPDATE `players` SET `points` = `points` + 1 WHERE `name` = '"..getCreatureName(mostDamageKiller).."';")
        local result = db.getResult("SELECT `points` FROM `players` WHERE `name` = '"..getCreatureName(lastHitKiller).."';")
        if isInArray(result:getID(),braodcast) == TRUE then
            id = result:getDataInt("points")
            doBroadcastMessage(""..getCreatureName(lastHitKiller).." has "..id.." Points!", 1)
        end   
        end
        end
 
PHP:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)

    local broadcast = {3,6,9,12,15,18,21}

    if isPlayer(mostDamageKiller) == TRUE then
        db.executeQuery("UPDATE `players` SET `points` = `points` + 1 WHERE `name` = '"..getCreatureName(lmostDamageKiller).."';")
        local result = db.getResult("SELECT `points` FROM `players` WHERE `name` = '"..getCreatureName(mostDamageKiller).."';")
        if isInArray((result:getID(),braodcast) == TRUE then
            id = result:getDataInt("points")
            doBroadcastMessage(""..getCreatureName(mostDamageKiller).." has "..id.." Points!", 1)
        end
    end
    if isPlayer(lastHitKiller) == TRUE and lastHitKiller ~= mostDamageKiller then
        db.executeQuery("UPDATE `players` SET `points` = `points` + 1 WHERE `name` = '"..getCreatureName(mostDamageKiller).."';")
        local result = db.getResult("SELECT `points` FROM `players` WHERE `name` = '"..getCreatureName(lastHitKiller).."';")
        if isInArray(result:getID(),braodcast) == TRUE then
            id = result:getDataInt("points")
            doBroadcastMessage(""..getCreatureName(lastHitKiller).." has "..id.." Points!", 1)
        end    
    end
    return TRUE
end


Still same error at console..
 
Back
Top