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

Creaturescripts lua

beliar34

Member
Joined
Feb 28, 2012
Messages
307
Solutions
7
Reaction score
11
i am looking for script to creaturescripts, with rule "if i dont mark somebody i dont hit him by aoe spell's, if i target somebody i hit only him by aoe spells" this is great script for anime servers and i cant find it
i got tfs 0.3.5
I know that script can be real becose 2 years ago when i was scripting i make this script
Code:
function onStatsChange(cid, attacker, type, combat, value)
if isPlayer(attacker) == false then
return true
end

if isPlayer(cid) == false then
return true
end

if isInParty(cid) == false then
return true
end

if getPlayerParty(cid) == getPlayerParty(attacker) then
if combat ~= COMBAT_HEALING then
return doPlayerSendCancel(cid, 'You cannot attack teammate.') and false
end
end

return true
end
This work that : if somebody is in party with you, you cant hit him

I forgot how to make scripts, i forgot half rules plz help me :D
 
Last edited:
Code:
function onStatsChange(cid, attacker, type, combat, value)
    if(attacker and isPlayer(attacker) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and getCreatureName(getCreatureTarget(attacker)) ~= getCreatureName(cid)) then
        if combat ~= COMBAT_HEALING then
    return doPlayerSendCancel(cid, 'You must mark player.') and false
end
end
return true
end
function onCombat(cid, target)
    if(target and isPlayer(target) and getCreatureName(getCreatureTarget(cid)) ~= getCreatureName(target)) then
    return doPlayerSendCancel(cid, 'You must mark player.') and false
end
return true
end

This works but i can mark players any tips ?
 
The second script is a little mess for me. You can just write an onCombat function that will check if the target is a player in the same party as you, and return false if the player and you are in the same party.
 
did you read what i write ? First script is my old script, and he is working perfectly but i am looking for script where we can't hit people by aoe spells !
i post first script for some help with functions xd
second script is working too but i cant mark players in pvp :(
 
Yes, i did read what you wrote.
Tell me if i'm wrong, and if i understood something wrong.
You don't want to be able to mark/attack the player who you're in a party with, but you WANT to be able to mark/attack every other player?
If so, there is an onCombat script that does exactly what i said. Just add your messages into it.
Code:
function onCombat(cid, target)
    if isInParty(cid) == true then
            if getPlayerParty(cid) == getPlayerParty(target) then
                return false
            else
            return true
            end
    else
    return true
    end
end
 
Nope, i got this script i got problem with aoe spells
i DONT WANT hit player if i dont mark him, BUT when i mark him i hit only him
I dont care about party script i post my version for help scripters i just show sample :p
 
creatureevent script that's supposed to only deal damage to players you are targeting using AOE spells.

Jeżeli nie zaznaczę gracza nie udeze go z ue, chodzi o to ze jak ktoś siedzi na expie to ludzie mu wbiegają specjalnie pod spelle i nabijają rs, chce troszkę także zmienić pvp aby spelle trafiały tylko tą postać którą zaznaczymy, pierwszy skrypt dałem jako przykład do blokady ataku.

Code:
function onStatsChange(cid, attacker, type, combat, value)
    if(attacker and isPlayer(attacker) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and getCreatureName(getCreatureTarget(attacker)) ~= getCreatureName(cid)) then
        if combat ~= COMBAT_HEALING then
            return false
        end
    end
return true
end
function onCombat(cid, target)
    if(target and isPlayer(target) and getCreatureName(getCreatureTarget(cid)) ~= getCreatureName(target)) then
        return false
    end
return true
end

Ten kod działa ale w ogóle zablokował pvp na moim ots, nie mogę nikogo zaznaczyć i chce to naprawić żebym mógł zaznaczyć


Możemy porozmawiac na ts3 na temat skryptu jezeli chcesz :)
 
Last edited:
W dziale support nie piszemy po polsku.

You shouldn't remove Erexo's signature from the script, but anyway.
You can't mark anyone because you're using onCombat script. You have to use onAttack instead.
Use this one. I found it here on Otland, just edited the function so credit goes to Summ. Here you go:
Code:
function onStatsChange(cid, attacker, type, combat, value)
local _target = getCreatureTarget(attacker)
if isPlayer(attacker) and isInArray({STATSCHANGE_MANALOSS, STATSCHANGE_HEALTHLOSS}, type) and _target ~= cid then
if combat ~= COMBAT_HEALING then
return false
end
end
return true
end


function onAttack(cid, target)
local _target = getCreatureTarget(cid)
if isPlayer(target) and target ~= _target then
return false
end
return true
end
 
Sorry for late asnwer i just back to home, you'r script dosent work
Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/AntiAOE.lua:onStatsChange

luaGetCreatureTarget(). Creature not found
 
I got TFS 0.3.5, sry for post wrong version in first post.


Post you creaturescripts.xml and login.lua :p
 
Last edited:
Back
Top