• 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] Some Lua Scripts Requests

Hrsha

Member
Joined
May 30, 2010
Messages
450
Reaction score
21
Location
Egypt
Hello Otlanders

i have some questions

1- distance weapon attackspeed .

how to set its attackspeed ? i could not do it by /attr spell
or set Attributes on items.xml

2- enchanting spell which make any weapon ( wands - bows - sword)
get stronger hit more dmage


i wish if u could understand me

thanks for reading .... rep ++
 
Last edited:
LUA:
function onLogin(cid)
	if (getPlayerVipDays(cid) == 0) and (getPlayerPromotionLevel(cid) == 3) then
		doPlayerSetPromotionLevel(cid, 2)
		doPlayerSave(cid)
	end
return true
end
----------------

I am using Action IDs on this script so it might fawk up another script if they're using the same AID, which I kinda doubt xD (it might give an error the first time you use the upgrade thingy)
LUA:
local max = 3
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray({2433, 2390, 2446, 7959, 7735, 7405, 8927, 7453, 7958, 8929, 2390, 6259, 8925}, itemEx.itemid) then
		if getItemAttribute(itemEx.uid, "aid") ~= (3570+max) then
			doItemSetAttribute(itemEx.uid, "description", " brutal attack speed 2.5%. It Belongs To ".. getCreatureName(cid) .. ".")
			doItemSetAttribute(itemEx.uid, "attackspeed", 650)
				if getItemAttribute(itemEx.uid, "aid") == nil then
					doItemSetAttribute(itemEx.uid, "aid", 3570)
				else
					doItemSetAttribute(itemEx.uid, "aid", (getItemAttribute(itemEx.uid, "aid")+1))
				end
			doPlayerSendTextMessage(cid, 19, "You have upgraded your weapon. Congratulations.")
			doRemoveItem(item.uid)
		else
			doPlayerSendCancel(cid, "You can only upgrade your item "..max.." times.")
		end
	else
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
return true
end
 
LUA:
function onLogin(cid)
    if (getPlayerVipDays(cid) == 0) and (getPlayerPromotionLevel(cid) == 3) then
        doPlayerSetPromotionLevel(cid, 2)
        doPlayerSave(cid)
    end
return true
end
----------------

I am using Action IDs on this script so it might fawk up another script if they're using the same AID, which I kinda doubt xD (it might give an error the first time you use the upgrade thingy)
LUA:
local max = 3
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isInArray({2433, 2390, 2446, 7959, 7735, 7405, 8927, 7453, 7958, 8929, 2390, 6259, 8925}, itemEx.itemid) then
        if getItemAttribute(itemEx.uid, "aid") ~= (3570+max) then
            doItemSetAttribute(itemEx.uid, "description", " brutal attack speed 2.5%. It Belongs To ".. getCreatureName(cid) .. ".")
            doItemSetAttribute(itemEx.uid, "attackspeed", 650)
                if getItemAttribute(itemEx.uid, "aid") == nil then
                    doItemSetAttribute(itemEx.uid, "aid", 3570)
                else
                    doItemSetAttribute(itemEx.uid, "aid", (getItemAttribute(itemEx.uid, "aid")+1))
                end
            doPlayerSendTextMessage(cid, 19, "You have upgraded your weapon. Congratulations.")
            doRemoveItem(item.uid)
        else
            doPlayerSendCancel(cid, "You can only upgrade your item "..max.." times.")
        end
    else
        doPlayerSendCancel(cid, "Sorry, not possible.")
    end
return true
end

Thanks too much ;) and rep +

UPDATED

almost done . just 2 issues
 
Last edited by a moderator:
Back
Top