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

Will this do the job?

Zuma Master

~Holes Through Happiness~
Joined
Jul 31, 2011
Messages
369
Reaction score
21
Location
Under your bed.
Hello. I have been trying to create a spell that teleports the caster to a random space in a 3x3 square around him. So, i have , after about one hour , resulted with this:
Code:
local playerpos = getCreaturePos(cid)
local position = {fromx = playerpos.x - 3, fromy = playerpos.y - 3, tox = playerpos.x + 3, toy = playerpos.y + 3, z = playerpos.z}

function onCastSpell(cid, spell, words)
               local pos = {x=math.random(position.fromx,position.tox),y=math.random(position.fromy,position.toy),z=position.z}
                 doTeleportThing(cid, pos)
	return 1
end
Will this , do the job? i have no server engine on this computer to test it , so i need to ask on the forums over here , by the way if it does work , feel free to use it , i dont mind at all.
 
Back
Top