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

clone rune

she clone the outfits of the players.. i have this script

function onUse(cid, item, frompos, item2, topos)

local outfit = getCreatureOutfit(item2.uid)

if item.itemid == 2306 then
doSetCreatureOutfit(cid, outfit, 3600000 )
doSendAnimatedText(topos,"Cloned!!",12)
doSendMagicEffect(getPlayerPosition(cid),27)
end
end


but he dont block clone god outfits :( sorry bad english (br here)
 
no.... is a rune, which when I try to use it on any player / monster she makes me like the monster that I used it, however .. This also works when using it in gods, and I wanted to block it
 
Lua:
local notAllowedOutfits = {75, 266, 302}

function onUse(cid, item, frompos, item2, topos)
	local outfit = getCreatureOutfit(item2.uid)
	if (isInArray(outfit, notAllowedOutfits)
		doSendAnimatedText(cid, "This outfit cannot be accessed."
		return true
	end

	doSetCreatureOutfit(cid, outfit, 3600000 )
	doSendAnimatedText(topos,"Cloned!!",12)
	doSendMagicEffect(getPlayerPosition(cid),27)
	return true
end
 
Lua:
local notAllowedOutfits = {75, 266, 302}

function onUse(cid, item, frompos, item2, topos)
	local outfit = getCreatureOutfit(item2.uid)
	if (isInArray(outfit, notAllowedOutfits)
		doSendAnimatedText(cid, "This outfit cannot be accessed."
		return true
	end

	doSetCreatureOutfit(cid, outfit, 3600000 )
	doSendAnimatedText(topos,"Cloned!!",12)
	doSendMagicEffect(getPlayerPosition(cid),27)
	return true
end


[05/12/2011 18:26:25] [Error - LuaScriptInterface::loadFile] data/actions/scripts/other/clone.lua:6: ')' expected (to close '(' at line 5) near 'doSendAnimatedText'
[05/12/2011 18:26:25] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/clone.lua)
[05/12/2011 18:26:25] data/actions/scripts/other/clone.lua:6: ')' expected (to close '(' at line 5) near 'doSendAnimatedText'


:S
 
6: ')' expected (to close '(' at line 5) near 'doSendAnimatedText'

doSendAnimatedText(cid, "This outfit cannot be accessed.")


[05/12/2011 20:43:00] [Error - LuaScriptInterface::loadFile] data/actions/scripts/other/clone.lua:6: ')' expected (to close '(' at line 5) near 'doSendAnimatedText'
[05/12/2011 20:43:00] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/clone.lua)
[05/12/2011 20:43:00] data/actions/scripts/other/clone.lua:6: ')' expected (to close '(' at line 5) near 'doSendAnimatedText'
 
try:

Lua:
local notAllowedOutfits = {75, 266, 302} 
local time = 10 --time for wear outfit in seconds -1 for infinite time
 
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not(isPlayer(itemEx.uid)) then
		return false
	end
	
	local pos = getThingPos(cid)
	local outfit = getCreatureOutfit(itemEx.uid)
	
	if not (isInArray(notAllowedOutfits, outfit.lookType)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your outfit has been changed." )
		doSetCreatureOutfit(cid, outfit, time)
		doSendAnimatedText(fromPosition,"Cloned!!",12)
		doSendMagicEffect(toPosition,27)
	else
		doPlayerSendCancel(cid, "Sorry, you can't clone that outfit")
	end
	
		
	return true
end
 
Last edited:
try:

Lua:
local notAllowedOutfits = {75, 266, 302} 
local time = 10 --time for wear outfit in seconds
 
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not(isPlayer(itemEx.uid)) then
		return false
	end
	
	local pos = getThingPos(cid)
	local outfit = getCreatureOutfit(itemEx.uid)
	
	if not (isInArray(notAllowedOutfits, outfit)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your outfit has been changed." )
		doSetCreatureOutfit(cid, outfit, time)
		doSendAnimatedText(fromPosition,"Cloned!!",12)
		doSendMagicEffect(toPosition,27)
	else
		doPlayerSendCancel(cid, "Sorry, you can't clone that outfit")
	end
	
		
	return true
end

Dont have distro errors.. but ... View attachment Fail.bmp
 
i don't know where are these outfits :p, i'm not in my house now, but you can get it and easily edit it in this simple list located in this line:
Lua:
local notAllowedOutfits = {75, 266, 302}
just put a comma to separate values
 
{75, 266, 302} <~~ this is ~> {GM OUTFIT, CM OUTFIT, GOD OUTFIT}... right? There are no errors in distro..

But still, even with this script, the rune cloning continues these outfits (75, 266, 302)

here my script:
local notAllowedOutfits = {75, 266, 302}
local time = 3600000 --time for wear outfit in seconds


function onUse(cid, item, fromPosition, itemEx, toPosition)
if not(isPlayer(itemEx.uid)) then
return false
end

local pos = getThingPos(cid)
local outfit = getCreatureOutfit(itemEx.uid)

if not (isInArray(notAllowedOutfits, outfit)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your outfit has been changed." )
doSetCreatureOutfit(cid, outfit, time)
doSendAnimatedText(fromPosition,"Cloned!!",12)
doSendMagicEffect(toPosition,27)
else
doPlayerSendCancel(cid, "Sorry, you can't clone that outfit")
end


return true
end


have erros in script?? (script by you jetro) ..
thanks..
 
Back
Top