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

Creaturescript target player

beliar34

Member
Joined
Feb 28, 2012
Messages
307
Solutions
7
Reaction score
11
Witam panów, mam prośbę otóż bardzo dawno temu przestałem skryptować LUE pod TFs'a no i zapomnialo sie to i owo :(
Potrzebuje skrypt który działa następująco, jezeli nie zaznacze danego gracza nie udeze go tzn
Expie sobie na expie bije moby przybiega ktos wbiega w obszar moich spelli i nie dostaje dmg do momentu az go zaznacze ale jezeli go zaznacze to udeze jako GRACZA TYLKO JEGO i oczywiscie moby normalnie bije
Dziekuje za uwage :D

Kiedys zrobiłem taki skrypt :
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

Napewno komus to pomoze, niestety nie potrafie go zedytowac :(
Dziekuje za uwage :D
 
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
--By Erexo (hail OTLand)
function onCombat(cid, target) 
if(target and isPlayer(target) and getCreatureName(getCreatureTarget(cid)) ~= getCreatureName(target)) then 
return false 
end 
return true 
end
Problem solved, close !
 
Not exactly

Code:
function onStatsChange(cid, attacker, type, combat, value)
if(isPlayer(cid) 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)
local zTarget = getCreatureTarget(cid)

if(isPlayer(target) and target ~= zTarget) then
return false
end
return true
end

I am using that one and i cant mark player !
 
Nie musisz sprawdzac name, samo getCreatureTarget(cid) ~= target wystarczy. Alternatywnie w drugim przypadku.
 
co niezmienia faktu ze nie moge zaznaczyc gracza xd

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
 
Back
Top Bottom