What im doing wrong on this tile?

Tbol

Member
Joined
Apr 7, 2019
Messages
113
Best answers
0
Reaction score
17
Why my tile doesnt work? TFS 1.2
Lua:
function onStepIn(cid, item, position)

if isPlayer(cid) == 1 then
doPlayerAddMana(cid,-100)
doPlayerAddHealth(cid,-100)
doPlayerAddSoul(cid,1)
doPlayerAddExp(cid, 10)
doPlayerAddSkillTry(cid,0,10)
        end
    return true
end
XML:
<movevent event="StepIn" itemid="448" script="damage.lua" />
 

zxmatzx

Intermediate OT User
Joined
Dec 1, 2010
Messages
155
Best answers
5
Reaction score
39
Why my tile doesnt work? TFS 1.2
Lua:
function onStepIn(cid, item, position)

if isPlayer(cid) == 1 then
doPlayerAddMana(cid,-100)
doPlayerAddHealth(cid,-100)
doPlayerAddSoul(cid,1)
doPlayerAddExp(cid, 10)
doPlayerAddSkillTry(cid,0,10)
        end
    return true
end
XML:
<movevent event="StepIn" itemid="448" script="damage.lua" />
Hello,
Try:
Lua:
function onStepIn(cid, item, position)
local player = Player(cid)
if player then
doPlayerAddMana(player,-100)
doPlayerAddHealth(player,-100)
doPlayerAddSoul(player,1)
doPlayerAddExp(player, 10)
doPlayerAddSkillTry(player,0,10)
end
    return true
end
 
OP
Tbol

Tbol

Member
Joined
Apr 7, 2019
Messages
113
Best answers
0
Reaction score
17
Hello,
Try:
Lua:
function onStepIn(cid, item, position)
local player = Player(cid)
if player then
doPlayerAddMana(player,-100)
doPlayerAddHealth(player,-100)
doPlayerAddSoul(player,1)
doPlayerAddExp(player, 10)
doPlayerAddSkillTry(player,0,10)
end
    return true
end
Okay so now at least it gave attempt to call doPlayerAddHealth so i replaced it with doCreatureAddHealth but now console crashes :D TFS 1.2 8.60
 

Perun

nems.online
Premium User
Joined
May 1, 2009
Messages
294
Best answers
5
Reaction score
116
Lua:
function onStepIn(creature, item, position, fromPosition)
    if(creature:isPlayer()) then
        creature:addMana(-100)
        creature:addHealth(-100)
        creature:addSoul(1)
        creature:addExperience(10)
        creature:addSkillTries(0,10)
    end
end
New tfs using class like scriptsystem, so you don't have to call function with creature id as parameter, you just call exacly creature class func.
 
OP
Tbol

Tbol

Member
Joined
Apr 7, 2019
Messages
113
Best answers
0
Reaction score
17
Lua:
function onStepIn(creature, item, position, fromPosition)
    if(creature:isPlayer()) then
        creature:addMana(-100)
        creature:addHealth(-100)
        creature:addSoul(1)
        creature:addExperience(10)
        creature:addSkillTries(0,10)
    end
end
New tfs using class like scriptsystem, so you don't have to call function with creature id as parameter, you just call exacly creature class func.
Hmm it crashes my server. This faking ninja tfs have a some kind of bug in health change or something like that. Any ideas?
 
OP
Tbol

Tbol

Member
Joined
Apr 7, 2019
Messages
113
Best answers
0
Reaction score
17
Leaving a visual debug log if someone have an idea
EDIT: FIXED
 
Last edited:
Top