gmstrikker
Well-Known Member
- Joined
- Jul 30, 2014
- Messages
- 458
- Solutions
- 1
- Reaction score
- 50
someone can arrange for me my script or tell me why you're not working?
It was meant to do: to kill the monsters come to the GPS bp guy who killed
lib/050-funcions.lua
login.lua
gp.lua
creatures,xml
It was meant to do: to kill the monsters come to the GPS bp guy who killed
lib/050-funcions.lua
Code:
function autoGP(cid, target, pos)
local itemid = 2148 -- id do gold coin
local function doStack(cid, itemid, new)
local count = getPlayerItemCount(cid, itemid)
if (count > 100) then
count = count - math.floor(count / 100) * 100
end
local newCount = count + new
if (count ~= 0) then
local find = getPlayerItemById(cid, true, itemid, count).uid
if (find > 0) then
doRemoveItem(find)
else
newCount = new
end
end
local item = doCreateItemEx(itemid, newCount)
doPlayerAddItemEx(cid, item, true)
end
end
login.lua
Code:
registerCreatureEvent(cid, "GP")
gp.lua
Code:
function onKill(cid, target, lastHit)
if not isPlayer(target) then
autoGP(cid, getCreatureName(target), getCreaturePosition(target))
end
return true
end
creatures,xml
Code:
<event type="kill" name="GP" event="script" value="gp.lua"/>
Last edited: