Jump to content

Help with an equipitem and unequipitem script


Recommended Posts

Im trying to make a script that gives a bullet time effect. When I equip the item, time slows around the player but they move at almost normal speed thanks to the spped Multi, but when I unequipt the item, time returns to normal but the speed effect is still there making the player super fast. I dont get why it runs the sgtm (to set the game time speed) but doesnt change the players movement speed back to normal, please can someone point out what im doing wrong, heres the script:

 

If I equipt the first item, time slows, but it I unequipt it then time returns to normal but the player speed stays at super fast,

 

Item 1 (to slow time)

 

ScriptName 1speedsuper

 

Begin OnEquip Player

 

sgtm 0.5

Player.SetActorValue SpeedMult 400

end

 

 

 

Item 2 (to speed up time)

 

Begin OnEquip Player

 

sgtm 1

Player.SetActorValue SpeedMult 100

end

Link to comment
Share on other sites

Unfortunately SpeedMult ONLY updates when used in a script upon certain things, such as holstering a weapon, equipping items or a change off the settings LeftMobilityCondition and RightMobilityCondition.

 

My suggestion is too just add these in after and hopefully they work

 

 

ScriptName 1speedsuper

short sCond

Begin OnEquip Player

sgtm 0.5
Player.SetActorValue SpeedMult 400
end


Begin OnEquip Player

sgtm 1
Player.SetActorValue SpeedMult 100
Player.DamageAV LeftMobilityCondition 1
Player.RestorAV LeftMobilityCondition 1

end

 

It will damage and then restore the damage.. Hopefully their LefMobilityCondition is not already 99 or whatever number you change it too, but it should work.

Link to comment
Share on other sites

Strangely I fixed the problem (I think). By putting both of these in the same scirpt. and setting the speed to normal when equipted and to fast (ie 400) when unequipted, for some reason when playing it does the opposite effect.

 

What I mean is, when I equipt the item time slows, when I unequipt it then it returns to normal with normal speed, strange but here the script I used.

Logically it shouldnt do what it does, but for some reason it works perfectly but Im not going to argue with the infinte power of the GECK if it decided to swing in my favour. Thanks for the help.

 

 

 

ScriptName 1speedsuper

 

Begin OnUnEquip

sgtm 1

Player.Unequipitem 0powersuperspeed

Player.SetActorValue SpeedMult 200

 

end

 

Begin OnEquip

sgtm 0.5

 

Player.Equipitem 0powersuperspeed

Player.SetActorValue SpeedMult 100

 

end

Link to comment
Share on other sites

  • Recently Browsing   0 members

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