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

TFS 8.60 0.3.6 CD

Itutorial

Board Moderator
Staff member
Board Moderator
Joined
Dec 23, 2014
Messages
2,464
Solutions
68
Reaction score
1,129
Is there anyway to add flag values to a player and remove them. I am trying to set up a quest to make it so the player cant be attacked by monsters, then after he is done he can be attacked again.
 
Make another group, add the flags and then just change the players groupid. Or you could just make a creaturescript that doesn't allow the player to be attacked.
 
Using the groupid method would require me to make the character logout before its input.

How would I go about a creaturescript like this? Maybe with a storage:
Code:
function onTarget(cid, target)
if getPlayerName(target) then
     if getPlayerStorageValue(target, storage) == 1 then
           return false
     end
end
end

Would this work? or maybe this:


Code:
function onTarget(cid, target)
if getPlayerName(target) then
     if getPlayerStorageValue(target, storage) == 1 then
           return target.flags = PLAYERFLAG_IGNOREDBYMONSTERS
     end
end
end
 
Using the groupid method would require me to make the character logout before its input.

How would I go about a creaturescript like this? Maybe with a storage:
Code:
function onTarget(cid, target)
if getPlayerName(target) then
     if getPlayerStorageValue(target, storage) == 1 then
           return false
     end
end
end

Would this work? or maybe this:


Code:
function onTarget(cid, target)
if getPlayerName(target) then
     if getPlayerStorageValue(target, storage) == 1 then
           return target.flags = PLAYERFLAG_IGNOREDBYMONSTERS
     end
end
end
Nah you wouldn't need to logout at all. But you would have to register the creaturescript with the monsters in the quest and it would be something like this:
Code:
function onTarget(cid, target)
    if isPlayer(target) then
        if getCreatureStorage(target, storage) == 1 then
            return false
        end
    end
return true
end
 
Back
Top