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

[Request] 3 scripts needed

sebas182

New Member
Joined
Aug 10, 2008
Messages
121
Reaction score
1
I have search along 20 pages of scripts but not found...
i need some scripts and i'll post it below.
i have asked to Azi do it for me, but no answers after two days.
i have tryed some times but i am far away from a good result.


1 script - Scroll of Exp (diferently)
Script: I need a script that when you use a scroll...
-Up the exp rate from 5x to 10x.
-Duration, one hour.
-Add some thing to just one can be usable at time... if use two do not goes to 15x, and do not delete the item, just send a error message like: item already in use. or something like that.


2 script - Scroll of attack speed and spell of attack speed
script: I need a script that when you use a scroll...
-Up attack speed from 2000 to 1500.
-Duration, one minute
-buff icon
-the spell is an area buff who does not needs party
-the scroll adds just to the user
-both cannot be used togueter, or can but just one up, continue at 1500 attack speed


3 script - Special door
script: A script that when you use the special door (against intruses), you just pass it normaly...
[I realy don't know how to use it]
-if player have an storage id "x" at value "1" it enter.
-another just block normaly.



I realy need it with urgency! please some one help me! i'll add rep ++ imediately!
 
Last edited:
This is for special doors.

You must change the blue line if you want to request another storagevalue

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition) 

if(isInArray(specialDoors, item.itemid) == TRUE) then 
[COLOR="Blue"]if getPlayerStorageValue(cid, 2009) < 10 then[/COLOR]
		doTransformItem(item.uid, item.itemid + 1) 
		doTeleportThing(cid, toPosition, TRUE) 
	else 
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders") 
	end 
		return TRUE 
end 
	return TRUE 
end
 
Exp Scroll - Not Tested

Note:
If it does not work, I will fix/test it later.
 
Last edited:
In exp scroll i got a error at line 12, unexpected symbol near "+"
then i just put it without the "+" and test, i got the message of sucess but don't up the exp and don't delete the item.

I got a error too, says that setPlayerExtraExpRate has a nil value (i use the last the forgotten server)
 
Appers the message: You have 1 minutes of double exp.
But do not delete and do not up the exp...
and says the error (at server)
Attempt to call global 'setPlayerExtraExpRate' (a nil value)

again =\

edit~
Before when i reused it appers the message, "You still have blablabla", now it just don't use and don't appers anything!
 
12:54 You have 1 minutes of double exp.
12:54 You still have double experience time left.

no exp changes and do not delete the item =\

i am trying to make some changes here but has not effect!

omg it is impossible?

edit~

can you use that? doPlayerSetRate(cid, type, value)
 
Hahahaha!
I used, the scroll deleted, the message showed, but now i don't gain anything of exp, nothing... (i changed the expRate to 10)

i must go now, i'll back in 40 minutes or less ...

Thanks by help me, i already rep ++ you :p

and please keep trying xDDD
 
id love to help, im sure some people would want this. I wouldnt mind having a look at the finished result in seeing how you'd code a scroll to change the exp rates.

Will check back
 
not tested:

Code:
local config = {
	rate = 2.0, -- 2.0 = 2x faster than normal
	time = 60, -- in minutes
	storage = 20532
}

function function onUse(cid, item, fromPosition, itemEx, toPosition)
	local tid = itemEx.uid or cid
	if(isPlayer(tid) ~= TRUE) then
		return FALSE
	end

	local status = getPlayerStorageValue(tid, config.storage)
	if(status ~= -1) then
		doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, "Your extra experience rate is already activated! It will expire at: " .. os.date("%X", status))
		return TRUE
	end

	doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated! It is now: " .. config.rate .. ".")
	doPlayerSetExperienceRate(tid, config.rate)
	setPlayerStorageValue(tid, config.storage, os.time())
	doRemoveItem(item.uid, 1)
	addEvent(experienceEnd, config.time * 60 * 1000, tid)
	return TRUE
end

local function experienceEnd(cid)
	doPlayerSetExperienceRate(cid, 1.0)
	setPlayerStorageValue(tid, config.storage, -1)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate have passed.")
end

How its supposed to work.

1. Player activate extra experience rate by using an item. Item is removed.
2. Player can use only 1 item for specified amount of time. If time is passed - he can use next item.
 
testing, edit later!

Editing... First of all...

Function Function?

I fix it /\

and looks working great, just one problem...
i put one minute, to test... then:
21:52 Your extra experience rate has been activated! It is now: 2.
21:53 Your extra experience rate is already activated! It will expire at: 22:00:01

it endures 8 minutes... i just waiting the eight minutes to say if it just finish and return the exp back...

editing~
The exp get back, but the delay still higher... i make a modify and testing.
 
Last edited:
I made it work!!!
I will edit with the script!

NOT REALY FINE WORKING! WAIT THE BUG FIXES

If you will use please don't delete the CREDITS!!!

Here we go!:
Code:
-- Credits: 99% by slawkens, 1% by sebas182, both from otland.
local config = {
	rate = 2.0, -- 2.0 = 2x faster than normal
	time = 1, -- in minutes
	storage = 20242
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local tid = itemEx.uid or cid
	if(isPlayer(tid) ~= TRUE) then
		return FALSE
	end

	local status = getPlayerStorageValue(tid, config.storage)
	if(status ~= -1) then
		doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, "Your extra experience rate is already activated!")
		return TRUE
	end

	doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated!")
	doPlayerSetExperienceRate(tid, config.rate)
	setPlayerStorageValue(tid, config.storage, 1)
	doRemoveItem(item.uid, 1)
	addEvent(experienceEnd, config.time * 60000, tid)
	return TRUE
end

function experienceEnd(cid)
	doPlayerSetExperienceRate(cid, 1.0)
	setPlayerStorageValue(tid, config.storage, -1)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate have passed.")
end


This one do not show when it will expire, but it not many useful and have some bugs...

In my server it will endures 24 hours, then, if you use it, you will know when it will expire -.-'

Anyway it show up a message when expires off.
 
Last edited:
then you can add simply onLogin script, which is resetting storage

Code:
local config = {
	storage = 20532
}

function onLogin(cid)
	if(getPlayerStorageValue(cid, config.storage) ~= -1) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has gone.")
		setPlayerStorageValue(cid, config.storage)
	end
	return TRUE
end

And fixed previous, with expire time if someone need:
Code:
local config = {
	rate = 2.0, -- 2.0 = 2x faster than normal
	time = 60, -- in minutes
	storage = 20532
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local tid = itemEx.uid or cid
	if(isPlayer(tid) ~= TRUE) then
		return FALSE
	end

	local status = getPlayerStorageValue(tid, config.storage)
	if(status ~= -1) then
		doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, "Your extra experience rate is already activated! It will expire at: " .. os.date("%X", status))
		return TRUE
	end

	doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated! It is now: " .. config.rate .. ".")
	doPlayerSetExperienceRate(tid, config.rate)
	setPlayerStorageValue(tid, config.storage, os.time() + config.time * 60 * 1000)
	doRemoveItem(item.uid, 1)
	addEvent(experienceEnd, config.time * 60 * 1000, tid)
	return TRUE
end

local function experienceEnd(cid)
	doPlayerSetExperienceRate(cid, 1.0)
	setPlayerStorageValue(tid, config.storage, -1)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate have passed.")
end

@down, ty fixed
 
Last edited:
Back
Top