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

Buy items with ID:xxxx insted of ordinary coins

ewcke

Santiria 8.60
Joined
Apr 13, 2009
Messages
39
Reaction score
1
TO MOD OR ADMIN:
PLEASE CLOSE THIS THRIED!!

I'm looking for a Npc script where you are able to buy items with other than ordinary coins.
Lets say that.

1. You earn Scarab Coins by killing other players.
2. You go to "ex.Scaraber NPC" and buy special offer items with Scarab Coins.

Is this possible? And if so, please post a script down below.

SCARAB COIN ID: 2159

Thanks.
 
Last edited:
It will function with a normal npc mixing it with the talkaction to buy....
To earn scarab coins when you kill players you need a onKill creaturescripts....
I will do it for you the next weekend if anybody help ;) Because i will not have internet in my pc until the next weekend and now i'm in another pc... :/
 
I made it here, so it would have some errors.... :S
Lua:
local maxsp = 10
local minsp = 1
function onKill(cid, target, lastHit)
if (isPlayer(cid) and isPlayer(target)) then
doPlayerAddItem(cid, 2159, math.random(minsp, maxsp)
end
return true
end
This will give you between 1 and 10 scarab coins when you kill a player, randomly... ^^ But you can configure it:
local minsp = 1 is the minimum of scarab coins and local maxsp = 10 is the maximum scarab coins... :D
I hope this works to give you the scarab coins.... :) Obiously, like all the times, Cykotitan will found an error but will fix it ;)

P.D.: I will make your npc in some daays... i'm occupy with exams for school and with my own proyect :p lol But i will help, don't worry ;)
 
Last edited:
Theres an error here:
Lua:
for i = minsp, maxsp do
doPlayerAddItem(cid, 2159, i)
end

This will loop 10 times leading the i to be 1,2,3,4,5,6,7,8,9,10
So it basically add the player itemID 2159, 1 time then same itemID but 2 times and so on.
To make it randomly just use math.random function
Lua:
math.random(1,10)
 
Back
Top