• 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 Bugged script

kimokimo

Kimo
Joined
Jan 25, 2011
Messages
821
Solutions
6
Reaction score
156
GitHub
karimadnan
PHP:
local config = {
reward = 9020, --Vampire Token
teamStore = 1000,
flagStore = 2015,
depot = {x=1000, y=1000, z=7}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(cid) == TRUE then
		doSendMagicEffect(fromPosition, CONST_ME_CRAPS)
	end
	
	local plural=''
	local value = math.random(5792, 5797)
	local outcome = value - 5791
	if doPlayerAddItem(cid,config.reward,outcome,true) then
	doTransformItem(item.uid, value)
	doSendMagicEffect(toPosition, 2)	
	doTeleportThing(cid,config.depot,false)
	doSendMagicEffect(config.depot, 10)
	doRemoveCondition(cid,CONDITION_INFIGHT)
	doRemoveCondition(cid, CONDITION_OUTFIT)
	setPlayerStorageValue(cid,1001,0)
	setPlayerStorageValue(cid,config.teamStore,0)
	setPlayerStorageValue(cid,config.flagStore,0)
	doCreatureSay(cid, getCreatureName(cid) .. ' rolled a ' .. outcome .. '.', TALKTYPE_ORANGE_1)
	if outcome > 1 then
	plural = 's'
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,'You were rewarded with '.. outcome ..' event token'..plural..'.')
	else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,'You were rewarded with '.. outcome ..' event token'..plural..'.')
	end	
	else
	doCreatureSay(cid,'You do not have enough capacity.', TALKTYPE_ORANGE_1)
end
	return true
end

i have found this in frozen-hell datapack but it dont work when i click on the item it keep saying you dont have nough cap and i already have empty bp and 10k cap :S can anyone check if there is anything wrong?
 
LUA:
local config = {
reward = 9020, --Vampire Token
teamStore = 1000,
flagStore = 2015,
depot = {x=518, y=840, z=7}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(cid) == TRUE then
		doSendMagicEffect(fromPosition, CONST_ME_CRAPS)
	end
	
	local plural=''
	local value = math.random(5792, 5797)
	local outcome = value - 5791
	if doPlayerAddItem(cid,config.reward,outcome,false) then
	doTransformItem(item.uid, value)
	doSendMagicEffect(toPosition, 2)	
	doTeleportThing(cid,config.depot,false)
	doSendMagicEffect(config.depot, 10)
	doRemoveCondition(cid,CONDITION_INFIGHT)
	doRemoveCondition(cid, CONDITION_OUTFIT)
	setPlayerStorageValue(cid,1001,0)
	setPlayerStorageValue(cid,config.teamStore,0)
	setPlayerStorageValue(cid,config.flagStore,0)
	doCreatureSay(cid, getCreatureName(cid) .. ' rolled a ' .. outcome .. '.', TALKTYPE_ORANGE_1)
	if outcome > 1 then
	plural = 's'
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,'You were rewarded with '.. outcome ..' event token'..plural..'.')
	else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,'You were rewarded with '.. outcome ..' event token'..plural..'.')
	end	

	else
	doCreatureSay(cid,'You do not have enough capacity.', TALKTYPE_ORANGE_1)
end
	return true
end

Try this idk if it will work i didn't test it.
 
There:
LUA:
local config = { 
	reward = 9020, --Vampire Token 
	teamStore = 1000, 
	flagStore = 2015, 
	depot = {x=1000, y=1000, z=7} 
} 
function onUse(cid, item, fromPosition, itemEx, toPosition) 
    if isPlayer(cid) == TRUE then 
        doSendMagicEffect(fromPosition, CONST_ME_CRAPS) 
    end
    
    local value = math.random(5792, 5797) 
    local outcome = value - 5791 
	doPlayerAddItem(cid, config.reward, outcome)
	doTransformItem(item.uid, value) 
	doSendMagicEffect(toPosition, 2)     
	doTeleportThing(cid,config.depot,false) 
	doSendMagicEffect(config.depot, 10) 
	doRemoveCondition(cid,CONDITION_INFIGHT) 
	doRemoveCondition(cid, CONDITION_OUTFIT) 
	setPlayerStorageValue(cid,1001,0) 
	setPlayerStorageValue(cid,config.teamStore,0) 
	setPlayerStorageValue(cid,config.flagStore,0) 
	doCreatureSay(cid, getCreatureName(cid) .. ' rolled a ' .. outcome .. '.', TALKTYPE_ORANGE_1) 
	if outcome > 1 then 
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,'You were rewarded with '.. outcome ..' event tokens.') 
	else 
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,'You were rewarded with '.. outcome ..' event token.') 
	end
    return true 
end
 
Back
Top