monster pause tfs1x

theduck

Member
Joined
Dec 6, 2018
Messages
157
Best answers
0
Reaction score
16
Is it possible to make a function that when executed the monster 'name' is still for a few seconds?
 

zxmatzx

Well-Known Member
Joined
Dec 1, 2010
Messages
194
Best answers
10
Reaction score
54
tested it didn't work
Hi,
You compiled your sources after the changes? Im using this function in my server and is working Ok... Have some error? What dont worked? Give more info and i try to help you.
 
OP
T

theduck

Member
Joined
Dec 6, 2018
Messages
157
Best answers
0
Reaction score
16
Hi,
You compiled your sources after the changes? Im using this function in my server and is working Ok... Have some error? What dont worked? Give more info and i try to help you.
just doesn't work without errors in srv ..
I'm trying to do something in lua
 

zxmatzx

Well-Known Member
Joined
Dec 1, 2010
Messages
194
Best answers
10
Reaction score
54
just doesn't work without errors in srv ..
I'm trying to do something in lua
Send the code u are using please.
In lua you can set the speed of the monster to 0, then it will not move.
myMonster:changeSpeed(-myMonster:getSpeed())
 
OP
T

theduck

Member
Joined
Dec 6, 2018
Messages
157
Best answers
0
Reaction score
16
Send the code u are using please.
In lua you can set the speed of the monster to 0, then it will not move.
myMonster:changeSpeed(-myMonster:getSpeed())
when the player clicks on the item the demon should stop walking for a few seconds demon is just an example will be a boss that only has 1 in the game

Code:
local monster = "demon"
  monster:setNoMove(false)

  addEvent(function(mid)
    Monster(mid):setNoMove(false)
    end, 3000, monster:getId())
 

  return true
end
 

zxmatzx

Well-Known Member
Joined
Dec 1, 2010
Messages
194
Best answers
10
Reaction score
54
when the player clicks on the item the demon should stop walking for a few seconds demon is just an example will be a boss that only has 1 in the game

Code:
local monster = "demon"
  monster:setNoMove(false)

  addEvent(function(mid)
    Monster(mid):setNoMove(false)
    end, 3000, monster:getId())


  return true
end
In this case, monster variable is a string. You can't access the userdata of the monster like this. Try search in area, look for the boss and get the userdata.
Look from startPosition to endPosition, get tile in each interation, get creatures in the tile, check if the creature is the boss that you want to stop and then stop it...
How works your boss room? This boss is unique? If yes, you can store the boss userData in a global variable when it was summoned, to avoid search in area...
 
Top