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

Lua Script for ADD x POINTS ITEM [TFS 1.2]

Xedoxo

Member
Joined
Oct 24, 2010
Messages
131
Reaction score
19
Hi

Someone have script for "points scroll" adds points to sms shop after use and dissapear.
 
Solution
LUA:
local pointsAmount = 10

function onUse(player, item, fromPos, target, toPos, isHotkey)
    if not player then
        return true
    end
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You received '..pointsAmount..' premium points')
    db.query("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. pointsAmount .. " WHERE `id` = " .. player:getAccountId())
    item:remove(1)
    return true
end

Try this, not tested but should work ( I hope ) :D
LUA:
local pointsAmount = 10

function onUse(player, item, fromPos, target, toPos, isHotkey)
    if not player then
        return true
    end
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You received '..pointsAmount..' premium points')
    db.query("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. pointsAmount .. " WHERE `id` = " .. player:getAccountId())
    item:remove(1)
    return true
end

Try this, not tested but should work ( I hope ) :D
 
Last edited:
Solution
LUA:
local pointsAmount = 10

function onUse(player, item, fromPos, target, toPos, isHotkey)
    if not player then
        return true
    end
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You received '..pointsAmount..' premium points')
    db.query("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. pointsAmount .. " WHERE `id` = " .. player:getAccountId())
    item:remove(1)
    return true
end

Try this, not tested but should work ( I hope ) :D
WORKS! Thank you a lot.
 
Back
Top