cavazospedro
Member
So i was trying to use an item to increase the critical chance hit or any other stat with this script and it works in the data base but it doesn show it up in the client, and when the player disconect it doesnt save in the data base so this is the script
Lua:
local criticalhit = Action()
function criticalhit.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local points = 100 -- quantidade de coins que o item vai dar
db.query("UPDATE `players` SET `skill_critical_hit_chance` = `skill_critical_hit_chance` + '" .. points .. "' WHERE `account_id` = '" .. player:getAccountId() .. "';")
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received "..points.." critical hit chance.")
item:remove(1)
return true
end
criticalhit:id(2294)
criticalhit:register()