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

Lua Donated uh [need help fast like hell]

killing

Member
Joined
Feb 23, 2012
Messages
815
Reaction score
11
Location
BIH
Hello everyone I wanted to add exhaustion to my Donated MR (Im using 3.6 tfs)
And i add it like this look

LUA:
function onUse(cid, item, frompos, item2, topos)
	doSendMagicEffect(topos,1)
	doCreatureSay(cid,"Donation MR!", TALKTYPE_ORANGE_1)
	doPlayerAddMana(cid, 23855)
	doPlayerexhaustion(cid, 1600)
	return true
end

This
LUA:
doPlayerexhaustion(cid, 1600)

and when i use Donated uh i get this Pic = https://i.imgur.com/NMisgL5.png

i have no ide how to fix it!And im super bad at scripting!!!!
:w00t: I NEED HELP AND FAST
 
You can't make up something like doPlayerexhaustion(cid, 1600) and magically assume it works.
You have to add some functionality to it if you wanted to create a function like that.

You can just use the functions provided by TFS:
LUA:
exhaustion.check(cid, storage)
exhaustion.set(cid, storage, time)

You can see how Limos used it in another script: http://otland.net/f132/daily-quest-box-hourly-182448/

So, in your script:
LUA:
local config = {
	exhausttime = 1600,
	exhauststorage = 2309
}

function onUse(cid, item, frompos, item2, topos)
        if exhaustion.check(cid, config.exhauststorage) == false then
	     doSendMagicEffect(topos,1)
	     doCreatureSay(cid,"Donation MR!", TALKTYPE_ORANGE_1)
	     doPlayerAddMana(cid, 23855)
             exhaustion.set(cid, config.exhauststorage, config.exhausttime)
        else
             return false
        end
	return true
end

I'm typing at school with no notepad resources or testing, so please test this.
 
now my mr is not working at all
https://i.imgur.com/7fyvJfa.png

This script does not work
LUA:
local config = {
	exhausttime = 1600,
	exhauststorage = 2309
}
 
function onUse(cid, item, frompos, item2, topos)
        if exhaustion.check(cid, config.exhauststorage) == false then
	     doSendMagicEffect(topos,1)
	     doCreatureSay(cid,"Donation MR!", TALKTYPE_ORANGE_1)
	     doPlayerAddMana(cid, 23855)
             exhaustion.set(cid, config.exhauststorage, config.exhausttime)
        else
             return false
        end
	return true
end
 
Oh, it's probably exhausting you for 1600 seconds, not 1.6 seconds.
Try changing exhausttime from 1600 to 2.
 
Back
Top