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

Player can't use spells and runes script!

Potar

SocialWorld
Senator
Joined
Mar 1, 2009
Messages
1,661
Reaction score
125
Location
Warsaw, Poland
I requested for it there:

http://otland.net/f132/player-cant-use-spells-runes-script-163955/

I wrote smth, but it doesn't work.

I also registred it and add to xml like cast, but it doesn;t work without any errors.


LUA:
local fromPosition = {x = 341, y = 465, z = 7}
local toPosition = {x = 424, y = 520, z = 7}

function onCast(cid, target)

return not isInRange(getThingPosition(cid), fromPosition, toPosition)

end
 
Try
LUA:
local from,to = {x = 341, y = 465, z = 7},{x = 424, y = 520, z = 7}
function onCast(cid, target)
return isInRange(getThingPosition(cid), from, to) and false or true
end
 
try use onCombat

LUA:
function onCombat(cid, target) 
if isPlayer(cid) and isMonster(target) and isInRange(getCreaturePosition(cid), {x = 341, y = 465, z = 7}, {x = 424, y = 520, z = 7}) then
return false
end
return true
end
 
It doesn't work too :(

Meaby there are anothey way, like mute player on arena, if he there he cant use HASTE / STRONG haste etc. spells and magicwalls / trees.
 
Last edited:
add this in your spells scripts

LUA:
if isInRange(getCreaturePosition(cid), {x = 341, y = 465, z = 7}, {x = 424, y = 520, z = 7}) then
doPlayerSendCancel(cid,"You can not use this spell here.") return false
end

exemple:

LUA:
function onCastSpell(cid, var)
if isInRange(getCreaturePosition(cid), {x = 341, y = 465, z = 7}, {x = 424, y = 520, z = 7}) then
doPlayerSendCancel(cid,"You can not use this spell here.") return false
end
return doCombat(cid, combat, var)
end
 
Back
Top