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

[spell-helpme :) ]teleport and outfit change -dont work

Gesior.pl

Mega Noob&LOL 2012
Senator
Joined
Sep 18, 2007
Messages
2,965
Solutions
99
Reaction score
3,375
Location
Poland
GitHub
gesior
Can anyone tell me why my script doesnt work?
I want to teleport player and change his outfit when he login (or when he is on x,y,z position or when he use xxxx item). On my server are 2 teams, 2 spawns, 2 outfit colors. Script must set spawn and outfit of 1 team (random). I tried to make spell, but this spell dont work :(
spells.xml
Code:
<rune name="Polymorph" id="2270" aggressive="0" charges="1" needtarget="1" lvl="1" maglv="0" mana="0" soul="0" exhaustion="1000" prem="0" enabled="1" allowfaruse="1" script="polymorph.lua"></rune>
polymorph.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
local team = math.random(1, 2)
local condition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(condition, CONDITION_PARAM_TICKS, 72000000)
if team == "1" then
	local pos = {x=95, y=124, z=7}
	addOutfitCondition(condition, 0, 128, 0, 8, 0, 8)
else
	local pos = {x=96, y=124, z=7}
	addOutfitCondition(condition, 0, 131, 0, 50, 0, 50)
end
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
	doCombat(cid, combat, var)
	doTeleportThing(cid, pos)
	return TRUE
end
error:
Code:
Lua Script Error: [Spell Interface] 
data/spells/scripts/polymorph.lua:onCastSpell

attempt to index a number value
It only change outfit, dont teleport and always set same outfit (not random 1/2). Rune dont loss charges :/
 
Back
Top