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

[Help me!] Searing Fire

Trixon

New Member
Joined
Nov 9, 2008
Messages
39
Reaction score
0
Code:
local vocs = 4, 8, 12
local words = "Sweet I aint dead!"
local health = -10000
local mana = -10000

function onStepIn(cid, item, position, fromPosition)
	if getPlayerVocation(cid) == vocs then
		doCreatureSay(cid, words, 3)
	else
		doCreatureAddHealth(cid, health)
		doPlayerAddMana(cid, mana)
	end
end

I've saved this in movements under "poi_knight_fire.lua"


I've added the following to movements.xml
Code:
	<movement event="StepIn" uniqueid="3505" script="poi_knight_fire.lua"/>

I've tested this on my server but nothing happens when walking over the searing fire with uid 3505.

Can anyone see where I'm going wrong? thanks
 
check errors in console ;-)

local vocs = 4, 8, 12
Change to
local vocs = {4, 8, 12}

if getPlayerVocation(cid) == vocs then
Change to
if isInArray(vocs, getPlayerVocation(cid)) == TRUE then
 
I made the changes and tested it, still nothing is happening. The console is showing no errors either.

I'm using TFS 0.3 alpha 4 if that helps at all...
 
Code:
local config = {
	vocs = { 4, 8, 12 },
	msg = "Sweet I aint dead!"
	}

function onStepIn(cid, item, position, fromPosition)
	if isInArray(config.vocs, getPlayerVocation(cid)) == TRUE then
		doCreatureSay(cid, config.msg, TALKTYPE_YELL)
	else
		doCreatureAddHealth(cid, - getCreatureHealth(cid))
		doPlayerAddMana(cid, - getPlayerMana(cid))
	end
end
 
Code:
local config = {
       local vocs = {4, 8, 12},
       local words = "Sweet I aint dead!",
       local health = -10000,
       local mana = -10000,
       local uid = 3505
}

function onStepIn(cid, item, position, fromPosition)
	if item.uid == config.uid and isInArray(config.vocs, getPlayerVocation(cid)) == TRUE then
		doCreatureSay(cid, config.words, 3)
	else
		doCreatureAddHealth(cid, config.health)
		doPlayerAddMana(cid, config.mana)
	     end
      end
end
 
Code:
	<movement event="StepIn" uniqueid="3505" script="poi_knight_fire.lua"/>

Chekc again the script, i've removed a simbol ")"

PD: Next time post in Request Section =)
 
thats what i was thinking, but i checked a lot of times now and tested and re-tested and just nothing at all happens. is there another way to do this or is a movement script the only way?
 
Try this...

Code:
local config = {
       local vocs = {4, 8, 12},
       local words = "Sweet I aint dead!",
       local health = 10000,
       local mana = 10000,
       local uid = 3505
}

function onStepIn(cid, item, position, fromPosition)
	if item.uid == config.uid then 
            if isInArray(config.vocs, getPlayerVocation(cid)) == TRUE then
		doCreatureSay(cid, config.words, TALKTYPE_YELL)
	else
		doPlayerAddHealth(cid, -config.health)
		doPlayerAddMana(cid, -config.mana)
	          end
           end
     end

movements.xml...
Code:
	<movement event="StepIn" uniqueid="3505" script="poi_knight_fire.lua"/>
 
Last edited:
darkhaos...you got one too many end's, here you go.
Code:
local config = {
       local vocs = {4, 8, 12},
       local words = "Sweet I aint dead!",
       local health = 10000,
       local mana = 10000,
       local uid = 3505
}

function onStepIn(cid, item, position, fromPosition)
	if item.uid == config.uid then 
            if isInArray(config.vocs, getPlayerVocation(cid)) == TRUE then
		doCreatureSay(cid, config.words, TALKTYPE_YELL)
     	    else
		doPlayerAddHealth(cid, -config.health)
		doPlayerAddMana(cid, -config.mana)
            end
        end
end

Jo3
 
darkhaos...you got one too many end's, here you go.
Code:
local config = {
       local vocs = {4, 8, 12},
       local words = "Sweet I aint dead!",
       local health = 10000,
       local mana = 10000,
       local uid = 3505
}

function onStepIn(cid, item, position, fromPosition)
	if item.uid == config.uid then 
            if isInArray(config.vocs, getPlayerVocation(cid)) == TRUE then
		doCreatureSay(cid, config.words, TALKTYPE_YELL)
     	    else
		doPlayerAddHealth(cid, -config.health)
		doPlayerAddMana(cid, -config.mana)
            end
        end
end

Jo3

Oh yeah sorry, i forgot delete the "ends" xD
 
Sorry for late reply, was out late then went to bed. Tested all codes again and still nothing happens, I'm gonna say this is some sort of bug however I'm gonna try replace the fire with another field and see if there is the sae problem.
 
Every movement script I make seems to have the same problem, no errors in the console yet in game nothing happens at all. Any ideas?
 
Try this one out.
PHP:
local config = {
    vocs = {4, 8, 12},
    words = "Sweet I aint dead!",
    health = 10000,
    mana = 10000,
    uid = 3505
}

function onStepIn(cid, item, pos)
    if item.uid == config.uid then
        if isInArray(config.vocs, getPlayerVocation(cid)) == TRUE then
            doCreatureSay(cid, config.words, TALKTYPE_YELL)
        else
            doPlayerAddHealth(cid, - config.health)
            doPlayerAddMana(cid, - config.mana)
        end
    end
end
 
Back
Top Bottom