CforMe
C how it works
- Joined
- Nov 26, 2015
- Messages
- 16
- Reaction score
- 1
I have made about 100 scripts like this and for some reason cannot figure out why this script is debugging my server. Here is the code can someone help me please?
Code:
local monster_name = "monstrosity"
local pos = {x = 2000, y = 2000, z = 7}
function onKill(cid, target)
if getCreatureName(target) == monster_name then
doPlayerSetVocation(cid, 1)
doTeleportThing(cid, pos)
doPlayerSetTown(cid, 2)
doRemoveCreature(cid, true)
doPlayerSetLevel(cid, 1)
doPlayerSetHealth(cid, 100)
doPlayerSetHealthMax(cid, 100)
doPlayerSetMana(cid, 30)
doPlayerSetManaMax(cid, 30)
end
return true
end
function doPlayerSetLevel(cid, level)
local query = db.executeQuery("UPDATE `players` SET `level` = '"..level.."' WHERE `id` ='"..getPlayerAccountId(cid).."'")
return query
end
function doPlayerSetHealth(cid, health)
local query = db.executeQuery("UPDATE `players` SET `health` = '"..health.."' WHERE `id` ='"..getPlayerAccountId(cid).."'")
return query
end
function doPlayerSetHealthMax(cid, healthMax)
local query = db.executeQuery("UPDATE `players` SET `healthmax` = '"..healthMax.."' WHERE `id` ='"..getPlayerAccountId(cid).."'")
return query
end
function doPlayerSetMana(cid, mana)
local query = db.executeQuery("UPDATE `players` SET `mana` = '"..mana.."' WHERE `id` ='"..getPlayerAccountId(cid).."'")
return query
end
function doPlayerSetManaMax(cid, manaMax)
local query = db.executeQuery("UPDATE `players` SET `manamax` = '"..manaMax.."' WHERE `id` ='"..getPlayerAccountId(cid).."'")
return query
end