• 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!

Critical chance hit item

cavazospedro

Member
Joined
Feb 16, 2021
Messages
33
Reaction score
7
GitHub
cavazospedro
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()
 
Back
Top