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

Special things

swordman

Member
Joined
Jun 5, 2011
Messages
394
Reaction score
7
Hi Otland,

anyone know how to make this.

-exp token

-animal dolls

-casino system


Repp+
 
Use search function???? :rolleyes:

exp token here.

http://otland.net/f16/amulet-experience-stage-58109/#post593427

Casino system.

LUA:
<?xml version="1.0" encoding="utf-8"?>
<mod name="Casino lever" enabled="yes">
  <action uniqueid="5885" event="script"><![CDATA[
		local pos = {x=1059, y=, z=925, stackpos = 255}
		local pos = {x=1059, y=, z=927, stackpos = 255}
		local pos = {x=1059, y=, z=929, stackpos = 255}
		local pos = {x=1059, y=, z=931, stackpos = 255}
		local pos = {x=1061, y=, z=923, stackpos = 255}
		local pos = {x=1063, y=, z=923, stackpos = 255}
		local pos = {x=1065, y=, z=923, stackpos = 255}
		local pos = {x=1067, y=, z=923, stackpos = 255}	
		local pos = {x=1069, y=, z=923, stackpos = 255}		
		local pos = {x=1071, y=, z=925, stackpos = 255}
		local pos = {x=1071, y=, z=927, stackpos = 255}
		local pos = {x=1071, y=, z=929, stackpos = 255}
		local pos = {x=1071, y=, z=931, stackpos = 255}
		local pos = {x=1061, y=, z=933, stackpos = 255}
		local pos = {x=1063, y=, z=933, stackpos = 255}
		local pos = {x=1065, y=, z=933, stackpos = 255}
		local pos = {x=1067, y=, z=933, stackpos = 255}
		local pos = {x=1069, y=, z=933, stackpos = 255}
		
		local cash = 2160
		local t = {
			[{1, 55}] = 0,
			[{56, 90}] = 2,
			[{91, 100}] = 3
		}
		local a, b = getItemInfo(cash).name, getItemInfo(cash).plural
 
		function onUse(cid, item, fromPosition, itemEx, toPosition)
			local v = getThingfromPos(pos)
			if v.itemid ~= cash then
				return doCreatureSay(cid, 'You can only use ' .. b .. '.', TALKTYPE_ORANGE_1, false, cid)
			end
 
			local r = math.random(100)
			for i, k in pairs(t) do
				if r >= i[1] and r <= i[2] then
					doRemoveItem(v.uid)
					if k < 1 then
						doCreatureSay(cid, 'You lost ' .. v.type .. ' ' .. (v.type == 1 and a or b) .. ' :(', TALKTYPE_ORANGE_1, false, cid)
						doSendMagicEffect(pos, CONST_ME_POFF)
					else
						doCreatureSay(cid, 'You won ' .. v.type * k .. ' ' .. (v.type == 1 and a or b) .. ' :)', TALKTYPE_ORANGE_1, false, cid)
						doCreateItem(cash, v.type * k, pos)
						doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
						doSendMagicEffect(toPosition, CONST_ME_SOUND_YELLOW)
					end
					return true
				end
			end
		end
	]]></action>
</mod>

I think this is the creature doll...

http://otland.net/f132/doll-change-your-aparence-creature-action-39678/
 
add properly this in actions



and ids in actions/scripts

Code:
--[[
	Advanced Slot Machine
		by oland	 
]]--
 
--REQUIRED MONEY(gp) TO PLAY SLOT MACHINE
local money = 1000
 
--MILISECONDS TO CHANGE FRUITS
local time = 200
 
--ITERATOR TIME TO STOP CHANGING FRUIT IF PLAYER DOESN'T (30 is like 7 seconds)
local limit = 30
 
--FRUITS THAT WILL RANDOMLY APPEAR AND SWITCH
local fruits = {2674,2675,2676,2679,2680,2682,2683,5097,8841}
 
--PRIZES TABLES
local win = {
-- [{FRUIT.1,FRUIT.2,FRUIT.3} = {PRIZE,#PRIZE}]
	--MIXED COMBOS
	[{2679,2683,2679}] = {2160,2},  -- cherry-pumpkin-cherry
	[{8841,2682,8841}] = {2160,1},  -- lemon-melon-lemon
	--TRIPLE COMBOS
	[{2680,2680,2680}] = {2152,80}, -- triple strawberry
	[{5097,5097,5097}] = {2152,60}, -- triple mango
	[{2683,2683,2683}] = {2152,80}, -- triple pumpkin
	[{2682,2682,2682}] = {2152,50}, -- triple melon
	[{2676,2676,2676}] = {2152,40}, -- triple banana
	[{8841,8841,8841}] = {2152,25}, -- triple lemon
	[{2679,2679,2679}] = {2152,20}, -- triple cherry
	[{2675,2675,2675}] = {2152,30}, -- triple orange
	[{2674,2674,2674}] = {2152,10}, -- triple apple
	--ANY COMBOS
	[{ANY,2683,2683}] = {2152,5}, -- double pumpkin right
	[{2683,2683,ANY}] = {2152,5}, -- double pumpkin left
	[{2683,ANY,2683}] = {2152,10}, -- pumpkin sides combo
	[{ANY,2679,2679}] = {2152,4}, -- double cherry right
	[{2679,2679,ANY}] = {2152,4}, -- double cherry left
	[{2679,ANY,2679}] = {2152,8}, -- cherry sides combo
	[{ANY,8841,8841}] = {2152,5}, -- double lemon right
	[{8841,8841,ANY}] = {2152,5}, -- double lemon left
	[{8841,ANY,8841}] = {2152,5}, -- lemon sides combo
}
 
--MESSAGES THAT RANDOMLY APPEAR WHEN PLAYER WINS
local messages = {'Bingo!','Lucky!','Jackpot!','Win!'}
 
--FRUITS ROWS
local p = { --[LEVER.UNIQUEID]
	[6297] = {},[6298] = {},[6299] = {},[6300] = {}, --[6301] = {},
} --JUST PUT THE INITIAL ROW POS FROM LEFT, SECOND & THIRD WILL BE AUTOM. GENERATED
for i = 1,3 do --p, UNIQUEID.LEVER, {POS FROM TILE OF LEFT}
	table.insert(p[6297],i,{x=992+(i-1),y=1015,z=7,stackpos=1})
	table.insert(p[6298],i,{x=996+(i-1),y=1015,z=7,stackpos=1})
	table.insert(p[6299],i,{x=1000+(i-1),y=1015,z=7,stackpos=1})
	table.insert(p[6300],i,{x=1004+(i-1),y=1015,z=7,stackpos=1})
	-- table.insert(p[6301],i,{x=19+(i-1),y=1015,z=7,stackpos=1})
end
 
function verifyRow(cid, array, pos)
	local result, prize = false, ''
	for a, b in pairs(win) do
		if getTileItemById(pos[1],a[1]).uid > 1 or a[1] == ANY then
			if getTileItemById(pos[2],a[2]).uid > 1 or a[2] == ANY then
				if getTileItemById(pos[3],a[3]).uid > 1 or a[3] == ANY then
					doPlayerAddItem(cid, b[1], b[2] or 1, true)
					doSendAnimatedText(getThingPos(cid), messages[math.random(#messages)], math.random(255))
					result, prize, amount = true, b[1], b[2]
				end
			end
		end	
	end
	if prize ~= '' then 
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Congratulations!! You won '..amount..' '..getItemPluralNameById(prize)..'!')
	end
	for i = 1,3 do 
		doSendMagicEffect(pos[i], result and CONST_ME_GIFT_WRAPS or CONST_ME_EXPLOSIONHIT)
		doRemoveItem(getTileThingByPos(pos[i]).uid)
	end
	return not result and doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You have lost in the Slot Machine :( Try again')
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
	local function doFruit(pos,cid,id,limit)
		if not isPlayer(cid) then
			return doItemEraseAttribute(item.uid, 'aid'), getTileThingByPos(pos).uid > 0 and doRemoveItem(getTileThingByPos(pos).uid)
		end
		if getTileThingByPos(pos).itemid < 1 then
			doSendMagicEffect(pos, CONST_ME_POFF)
			doCreateItem(fruits[math.random(#fruits)], 1, pos)
		else
			doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
		end
		if limit <= 0 then
			doSendMagicEffect(pos,math.random(28,30))		
			doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
			doItemSetAttribute(getTileThingByPos(fromPosition)  .uid, 'aid', getTileThingByPos(fromPosition).actionid+1)
			doTransformItem(getTileThingByPos(fromPosition).uid, getTileThingByPos(fromPosition).itemid == 9826 and 9825 or 9826)
		elseif getTileThingByPos(fromPosition).actionid > id then
			doSendMagicEffect(pos,math.random(28,30))
			doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
		else
			addEvent(doFruit,time,pos,cid,id,limit-1)
		end
	end
 
	if item.actionid == 0 then
		if not doPlayerRemoveMoney(cid, money) then	
			return doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You need '..money..' gps to play Slot Machine.')
		end
		doItemSetAttribute(item.uid, 'aid', 1)
		doCreatureSetNoMove(cid, true)
		doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
		doSendAnimatedText(getThingPos(cid), '-$'..money,COLOR_RED)
		for i = 1,3 do doFruit(p[item.uid][i],cid,i,i*limit) end
	elseif isInArray({1,2,3},item.actionid) then
		doItemSetAttribute(item.uid, 'aid', item.actionid+1)
		doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
	elseif item.actionid == 4 then
		doCreatureSetNoMove(cid, false)
		doItemEraseAttribute(item.uid, 'aid')
		doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
		verifyRow(cid, win, p[item.uid])	
	end		
	return true
end
 
add properly this in actions



and ids in actions/scripts

Code:
--[[
	Advanced Slot Machine
		by oland	 
]]--
 
--REQUIRED MONEY(gp) TO PLAY SLOT MACHINE
local money = 1000
 
--MILISECONDS TO CHANGE FRUITS
local time = 200
 
--ITERATOR TIME TO STOP CHANGING FRUIT IF PLAYER DOESN'T (30 is like 7 seconds)
local limit = 30
 
--FRUITS THAT WILL RANDOMLY APPEAR AND SWITCH
local fruits = {2674,2675,2676,2679,2680,2682,2683,5097,8841}
 
--PRIZES TABLES
local win = {
-- [{FRUIT.1,FRUIT.2,FRUIT.3} = {PRIZE,#PRIZE}]
	--MIXED COMBOS
	[{2679,2683,2679}] = {2160,2},  -- cherry-pumpkin-cherry
	[{8841,2682,8841}] = {2160,1},  -- lemon-melon-lemon
	--TRIPLE COMBOS
	[{2680,2680,2680}] = {2152,80}, -- triple strawberry
	[{5097,5097,5097}] = {2152,60}, -- triple mango
	[{2683,2683,2683}] = {2152,80}, -- triple pumpkin
	[{2682,2682,2682}] = {2152,50}, -- triple melon
	[{2676,2676,2676}] = {2152,40}, -- triple banana
	[{8841,8841,8841}] = {2152,25}, -- triple lemon
	[{2679,2679,2679}] = {2152,20}, -- triple cherry
	[{2675,2675,2675}] = {2152,30}, -- triple orange
	[{2674,2674,2674}] = {2152,10}, -- triple apple
	--ANY COMBOS
	[{ANY,2683,2683}] = {2152,5}, -- double pumpkin right
	[{2683,2683,ANY}] = {2152,5}, -- double pumpkin left
	[{2683,ANY,2683}] = {2152,10}, -- pumpkin sides combo
	[{ANY,2679,2679}] = {2152,4}, -- double cherry right
	[{2679,2679,ANY}] = {2152,4}, -- double cherry left
	[{2679,ANY,2679}] = {2152,8}, -- cherry sides combo
	[{ANY,8841,8841}] = {2152,5}, -- double lemon right
	[{8841,8841,ANY}] = {2152,5}, -- double lemon left
	[{8841,ANY,8841}] = {2152,5}, -- lemon sides combo
}
 
--MESSAGES THAT RANDOMLY APPEAR WHEN PLAYER WINS
local messages = {'Bingo!','Lucky!','Jackpot!','Win!'}
 
--FRUITS ROWS
local p = { --[LEVER.UNIQUEID]
	[6297] = {},[6298] = {},[6299] = {},[6300] = {}, --[6301] = {},
} --JUST PUT THE INITIAL ROW POS FROM LEFT, SECOND & THIRD WILL BE AUTOM. GENERATED
for i = 1,3 do --p, UNIQUEID.LEVER, {POS FROM TILE OF LEFT}
	table.insert(p[6297],i,{x=992+(i-1),y=1015,z=7,stackpos=1})
	table.insert(p[6298],i,{x=996+(i-1),y=1015,z=7,stackpos=1})
	table.insert(p[6299],i,{x=1000+(i-1),y=1015,z=7,stackpos=1})
	table.insert(p[6300],i,{x=1004+(i-1),y=1015,z=7,stackpos=1})
	-- table.insert(p[6301],i,{x=19+(i-1),y=1015,z=7,stackpos=1})
end
 
function verifyRow(cid, array, pos)
	local result, prize = false, ''
	for a, b in pairs(win) do
		if getTileItemById(pos[1],a[1]).uid > 1 or a[1] == ANY then
			if getTileItemById(pos[2],a[2]).uid > 1 or a[2] == ANY then
				if getTileItemById(pos[3],a[3]).uid > 1 or a[3] == ANY then
					doPlayerAddItem(cid, b[1], b[2] or 1, true)
					doSendAnimatedText(getThingPos(cid), messages[math.random(#messages)], math.random(255))
					result, prize, amount = true, b[1], b[2]
				end
			end
		end	
	end
	if prize ~= '' then 
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Congratulations!! You won '..amount..' '..getItemPluralNameById(prize)..'!')
	end
	for i = 1,3 do 
		doSendMagicEffect(pos[i], result and CONST_ME_GIFT_WRAPS or CONST_ME_EXPLOSIONHIT)
		doRemoveItem(getTileThingByPos(pos[i]).uid)
	end
	return not result and doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You have lost in the Slot Machine :( Try again')
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
	local function doFruit(pos,cid,id,limit)
		if not isPlayer(cid) then
			return doItemEraseAttribute(item.uid, 'aid'), getTileThingByPos(pos).uid > 0 and doRemoveItem(getTileThingByPos(pos).uid)
		end
		if getTileThingByPos(pos).itemid < 1 then
			doSendMagicEffect(pos, CONST_ME_POFF)
			doCreateItem(fruits[math.random(#fruits)], 1, pos)
		else
			doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
		end
		if limit <= 0 then
			doSendMagicEffect(pos,math.random(28,30))		
			doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
			doItemSetAttribute(getTileThingByPos(fromPosition)  .uid, 'aid', getTileThingByPos(fromPosition).actionid+1)
			doTransformItem(getTileThingByPos(fromPosition).uid, getTileThingByPos(fromPosition).itemid == 9826 and 9825 or 9826)
		elseif getTileThingByPos(fromPosition).actionid > id then
			doSendMagicEffect(pos,math.random(28,30))
			doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
		else
			addEvent(doFruit,time,pos,cid,id,limit-1)
		end
	end
 
	if item.actionid == 0 then
		if not doPlayerRemoveMoney(cid, money) then	
			return doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You need '..money..' gps to play Slot Machine.')
		end
		doItemSetAttribute(item.uid, 'aid', 1)
		doCreatureSetNoMove(cid, true)
		doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
		doSendAnimatedText(getThingPos(cid), '-$'..money,COLOR_RED)
		for i = 1,3 do doFruit(p[item.uid][i],cid,i,i*limit) end
	elseif isInArray({1,2,3},item.actionid) then
		doItemSetAttribute(item.uid, 'aid', item.actionid+1)
		doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
	elseif item.actionid == 4 then
		doCreatureSetNoMove(cid, false)
		doItemEraseAttribute(item.uid, 'aid')
		doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
		verifyRow(cid, win, p[item.uid])	
	end		
	return true
end


I actually wanted something like;

Someone uses a casino coin. And he can win a price like example an donation item but the chance is small :P

I hope u understand what I mean.
 
If you don't have the scripts, then this should be posted in request section...
 
Hi, thanks for helping all!

I tested the Exp token now, but one small problem. I hope ucan help me,
U can make it so when the item gets used the item gets removed?
PHP:
local config = {
	rate = 1.6, -- 4x More Experience
	time = 5, -- Hours of Exp Time
	storage = 20011
}
local function endExpRate(cid)
	if isPlayer(cid) == TRUE then
		doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate
		setPlayerStorageValue(cid, config.storage, -1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.")
	end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerStorageValue(cid, config.storage) < 0) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your extra experience rate is now: " .. config.rate .. ". It will last for ".. config.time .." hours.")
		doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
		setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600)
		addEvent(endExpRate, config.time * 3600 * 1000, cid)
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have extra experience time left.")
	end
	return TRUE
end
 
Where to put this script on, talkactions,actions or where is it?
and also this script is like when using the item u get turned into an outfit?
if yes, than can there be minimumtime of 30 sec to use the item everytime?

PHP:
local outfits = {5, 6, 7, 8, 9, 15, 18, 23, 24, 25, 29, 33, 37, 40, 48, 50, 53, 54, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 76, 78, 93, 96, 97, 98, 100, 126, 127, 193,
				 194, 195, 196, 203, 214, 215, 216, 229, 232, 235, 237, 246, 249, 253, 254, 255, 259, 260, 264, 281, 282, 287, 296, 297, 298, 300, 301}
local outfit =
	{
		lookType = 2,
		lookHead = 0,
		lookBody = 0,
		lookLegs = 0,
		lookFeet = 0,
		lookAddons = 0
	}
local outfit0 =
	{
		lookType = 2,
		lookHead = 0,
		lookBody = 0,
		lookLegs = 0,
		lookFeet = 0,
		lookAddons = 0
	}
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,1921) == -1 or getPlayerStorageValue(cid,1921) == #outfits then
setPlayerStorageValue(cid,1921,1)
doSetCreatureOutfit(cid, outfit0, -1)
else
for i=1,#outfits do
    if getPlayerStorageValue(cid,1921) == i then
         outfit.lookType = outfits[i]
             doCreatureSay(cid, "Change!", TALKTYPE_ORANGE_1)
                 doSetCreatureOutfit(cid, outfit, -1)
            setPlayerStorageValue(cid,1921,i+1)
break
     end
        end
     end
        end
 
Animal Doll:
Where to put this script on, talkactions,actions or where is it?
and also this script is like when using the item u get turned into an outfit?
if yes, than can there be minimumtime of 30 sec to use the item everytime?

And casino system:
I tested it, but I have a crystal coin in my bp. and it says you need a crystal coin everytime.
Its not working.
I am using 0.4 rev 3858


PHP:
local outfits = {5, 6, 7, 8, 9, 15, 18, 23, 24, 25, 29, 33, 37, 40, 48, 50, 53, 54, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 76, 78, 93, 96, 97, 98, 100, 126, 127, 193,
				 194, 195, 196, 203, 214, 215, 216, 229, 232, 235, 237, 246, 249, 253, 254, 255, 259, 260, 264, 281, 282, 287, 296, 297, 298, 300, 301}
local outfit =
	{
		lookType = 2,
		lookHead = 0,
		lookBody = 0,
		lookLegs = 0,
		lookFeet = 0,
		lookAddons = 0
	}
local outfit0 =
	{
		lookType = 2,
		lookHead = 0,
		lookBody = 0,
		lookLegs = 0,
		lookFeet = 0,
		lookAddons = 0
	}
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,1921) == -1 or getPlayerStorageValue(cid,1921) == #outfits then
setPlayerStorageValue(cid,1921,1)
doSetCreatureOutfit(cid, outfit0, -1)
else
for i=1,#outfits do
    if getPlayerStorageValue(cid,1921) == i then
         outfit.lookType = outfits[i]
             doCreatureSay(cid, "Change!", TALKTYPE_ORANGE_1)
                 doSetCreatureOutfit(cid, outfit, -1)
            setPlayerStorageValue(cid,1921,i+1)
break
     end
        end
     end
        end
 
thanks, but theres a way to make exhaustion on it?
like can only be used every 1 minut or something.

Thanks in advance bro :P

Look for a script with exhaust and just place it into the "animal" doll script..
 
Back
Top