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

SCRIPT (TFS 0.3.6pl1 )

gtk1990

New Member
Joined
Dec 12, 2008
Messages
8
Reaction score
0
I have used this script at TFS 0.3.6pl1
but item dont dissapear when used please help!

rep++

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = {
		max = 100, -- Max Level
		exp = 5000,
		remove = "yes" -- "yes" or "no"
	}
	cfg.remove = getBooleanFromString(cfg.remove)
	if getPlayerLevel(cid) < cfg.max then
		if cfg.remove then
			doRemoveItem(item.uid, 1)
			return true
		end
	else
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
	return doPlayerAddExperience(cid, cfg.exp) and doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
end
 
try
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = {
		max = 100, -- Max Level
		exp = 5000,
		removee = true -- true od false
	}
	
	if getPlayerLevel(cid) < cfg.max then
		if cfg.removee == true then
			doRemoveItem(item.uid,1)
			return true
		end
	else
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
	return doPlayerAddExperience(cid, cfg.exp) and doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
end
 
LUA:
local cfg = {
    max = 100, -- Max Level
    exp = 5000,
    remove = 'yes' -- "yes" or "no"
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local removed = getBooleanFromString(cfg.remove)
    if getPlayerLevel(cid) < cfg.max then
        if removed then
            doRemoveItem(item.uid, 1)
        end
        doPlayerAddExperience(cid, cfg.exp)
        doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
    else
        doPlayerSendDefaultCancel(cid, 2)
    end
    return true 
end
 
LUA:
local exp = 5000
function onUse(cid,item,fromPosition,itemEx,toPositon)
local v = getThingPos(cid)
	if getPlayerLevel(cid) < 100 then
		if doPlayerRemoveItem(cid,item.uid,1) then
			doPlayerAddExperience(cid,exp)
			doSendMagicEffect(v,CONST_ME_GIFT_WRAPS)
		end
	else
		doPlayerSendCancel(cid,'Not Possible')
	end
	return true
end

didn't notice other posts, lol.
 
Ye, but if player put item on floor, item not removed
Try
PHP:
local exp = 5000
function onUse(cid,item,fromPosition,itemEx,toPositon)
local v = getThingPos(cid)
	if getPlayerLevel(cid) < 100 then
		if doRemoveItem(item.uid, 1) then
			doPlayerAddExperience(cid,exp)
			doSendMagicEffect(v,CONST_ME_GIFT_WRAPS)
		end
	else
		doPlayerSendCancel(cid,'Not Possible')
	end
	return true
end
 
Back
Top