lavatumente Posted February 23, 2019 Share Posted February 23, 2019 (edited) 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, adangerous 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, anddo 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 plantwithout 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 totalf******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 heroof 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 busyshort activatedfloat fTrapDamagefloat fTrapPushBackfloat fTrapMinVelocityfloat fLevelledDamageshort bTrapContinuousref myParentref mySelfshort state short doonce  begin onmagiceffecthitset mySelf to getSelfset myParent to getParentRefif activated == 0 && busy == 0 && IsAnimPlaying == 0 message "Ahora que la planta está inconsciente, puedo recolectar sus ingredientes."PlayGroup turnleft 1else if activated == 1 && busy == 0 && IsAnimPlaying == 0 PlayGroup turnleft 1set activated to 2set busy to 1endifendifend Begin OnActivateset mySelf to getSelfset myParent to getParentRefif activated == 0 && busy == 0 && IsAnimPlaying == 0 myParent.activate mySelf 0 playgroup forward 0 set busy to 1set activated to 1 set fLevelledDamage to 1.5set fTrapDamage to 20set fTrapPushBack to 50set fTrapMinVelocity to 0set bTrapContinuous to 0 elseif activated == 1 && busy == 0 && IsAnimPlaying == 0 playgroup equip 0set activated to 0set busy to 1 elseif activated == 3 && busy == 0 && IsAnimPlaying == 0playgroup forward 0set activated to 4set busy to 1 set fLevelledDamage to 1.5set fTrapDamage to 20set fTrapPushBack to 50set fTrapMinVelocity to 0set bTrapContinuous to 0 elseif activated == 4 && busy == 0 && IsAnimPlaying == 0playgroup equip 0set activated to 3set busy to 1 endif if isActionRef player == 1if activated == 2 && busy == 0 && IsAnimPlaying == 0 message "Hello tÃo."PlayGroup turnright 1set fLevelledDamage to 1.5set fTrapDamage to 20set fTrapPushBack to 50set fTrapMinVelocity to 0set bTrapContinuous to 0 set activated to 3set busy to 1 endifendifif busy == 1 && IsAnimPlaying == 1set busy to 0endif End begin onreset set activated to 0set busy to 0set state to 0set doonce to 0Reset3DStateend Edited February 24, 2019 by lavatumente Link to comment Share on other sites More sharing options...
Recommended Posts