• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Scroll Premium Points in WebsiteShop

Monomalo00

http://leiends.ml/
Joined
Nov 13, 2010
Messages
120
Solutions
1
Reaction score
4
Hii! Any script so that when you give him a scroll, you get "X" premium points in shop? +REP
 
this one adds 30 premium points to your account in use

Code:
local points = 30 -- amount of premium points
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isPlayer(cid) == TRUE  then
 local Sql = "UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." where id="..getPlayerAccountId(cid)
                 db.executeQuery(Sql)
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You Have Received 30 Premium Point")
	doRemoveItem(item.uid)
	end
        return true
end
 
Last edited:
Change

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You Have Received 1 Premium Point")

to

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You Have Received "..points.." Premium Point")

And please, use search or learn some lua. This are EXREMLY easy/basic
 
this one adds 30 premium points to your account in use

Code:
local points = 30 -- amount of premium points
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isPlayer(cid) == TRUE  then
 local Sql = "UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." where id="..getPlayerAccountId(cid)
                 db.executeQuery(Sql)
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You Have Received 30 Premium Point")
	doRemoveItem(item.uid)
	end
        return true
end

where I put that?
 
If the function is onUse then it means it's an action, because you gonna use smthn. If it's onkill/look/death/preparedeath/login then they are a creaturescript (not sure if I missed some) and you also have movement and globalevents etc
 
use script Seleo
data/actions/scripts
create 1 file archive .lua
name.. points.lua
LUA:
local points = 30 -- amount of premium points
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isPlayer(cid) == TRUE  then
 local Sql = "UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." where id="..getPlayerAccountId(cid)
                 db.executeQuery(Sql)
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You Have Received 30 Premium Point")
	doRemoveItem(item.uid)
	end
        return true
end

and now goto data/actions open actions.xml
add this line
LUA:
<action itemid="123" script="points.lua"/>
or
LUA:
<action itemid="123" event="script" value="points.lua"/>

just only edit itemid="123" to itemid your scroll..
 
  1. local points = 30 -- amount of premium points

  2. function onUse(cid, item, fromPosition, itemEx, toPosition)
  3. if isPlayer(cid) == TRUE then
  4. local Sql = "UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." where id="..getPlayerAccountId(cid)
  5. db.executeQuery(Sql)
  6. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You Have Received 30 Premium Point")
  7. doRemoveItem(item.uid)
  8. end
  9. return true
  10. end

i got znote accounts i was changed but didnt added points ... Script work but dont add premium points please help
 
Back
Top