Jump to content

script for a dangerous plant


Recommended Posts

  • Hello, i need some help with a script, the script is attached to an mesh with animation forward, equip, turnleft and turnright, this mesh is a plant, a

  • dangerous plant, and is parent with another mesh very closer, so when the player walk arround the mesh parented to the plant, this activate the plant, and

  • do some damage to the player, but the player can shot a spell to the plant once, and then the plant will get unconscient, so the player can harvest the plant

  • without a risk, and when the player harvest the plant get up another time and come another time agressive when player is closer, but the script is a total

  • f******g s**t, when the player hit the plant with a spell, the plant will not play the animation, player must activate, or passing closer, and that is notÂ

  • what i want, i want shot a spell, and the plant, quickly play is animation, and then the player can harvest. So here is the script, and thank you if some hero

  • of scripting can helpme.

  • well... thanks for the time, and please give me some help ;) and sorry for my bad english. Best regards.

Â

*************************************************************************************************************************************************************

Â

scn AMPlantcarnivorScript01

Â

short busy

short activated

float fTrapDamage

float fTrapPushBack

float fTrapMinVelocity

float fLevelledDamage

short bTrapContinuous

ref myParent

ref mySelf

short stateÂ

short doonceÂ

Â

begin onmagiceffecthit

set mySelf to getSelf

set myParent to getParentRef

if activated == 0 && busy == 0 && IsAnimPlaying == 0

message "Ahora que la planta está inconsciente, puedo recolectar sus ingredientes."

PlayGroup turnleft 1

else

if activated == 1 && busy == 0 && IsAnimPlaying == 0Â

PlayGroup turnleft 1

set activated to 2

set busy to 1

endif

endif

end

Â

Begin OnActivate

set mySelf to getSelf

set myParent to getParentRef

if activated == 0 && busy == 0 && IsAnimPlaying == 0Â

myParent.activate mySelf 0

playgroup forward 0

set busy to 1

set activated to 1

set fLevelledDamage to 1.5

set fTrapDamage to 20

set fTrapPushBack to 50

set fTrapMinVelocity to 0

set bTrapContinuous to 0

elseif activated == 1 && busy == 0 && IsAnimPlaying == 0Â

playgroup equip 0

set activated to 0

set busy to 1

Â

elseif activated == 3 && busy == 0 && IsAnimPlaying == 0

playgroup forward 0

set activated to 4

set busy to 1

set fLevelledDamage to 1.5

set fTrapDamage to 20

set fTrapPushBack to 50

set fTrapMinVelocity to 0

set bTrapContinuous to 0

elseif activated == 4 && busy == 0 && IsAnimPlaying == 0

playgroup equip 0

set activated to 3

set busy to 1

endif

Â

if isActionRef player == 1

if activated == 2 && busy == 0 && IsAnimPlaying == 0Â

message "Hello tío."

PlayGroup turnright 1

set fLevelledDamage to 1.5

set fTrapDamage to 20

set fTrapPushBack to 50

set fTrapMinVelocity to 0

set bTrapContinuous to 0

set activated to 3

set busy to 1

endif

endif

if busy == 1 && IsAnimPlaying == 1

set busy to 0

endif

Â

End

Â

begin onresetÂ

set activated to 0

set busy to 0

set state to 0

set doonce to 0

Reset3DState

end

Â

Edited by lavatumente
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...