Jump to content

Need a Cloak script


eleglas

Recommended Posts

I'm trying to make a Spy mod, similar to the Spy class in Team Fortress 2, I have everything I need, except for a Cloak Watch. I'm trying to recreate the Cloak and Dagger version; for those of you who don't know the Cloak has a limited time when moving but recharges when staying still, the faster you move, the faster the cloak decreases; once out of power the cloak should drop.

 

So I want to make a cloak that 10 seconds worth of cloak time when running, but 60 seconds if sneaking. It also needs to recharge 2 seconds per second when staying still, it should not recharge if you are moving.

 

I need a script that can achieve this; thanks guys.

 

P.S: I know that sounds a bit complicated, but its the best I can describe it (I'm not very good at describing stuff); but if someone else wants to clarify it better than me, go ahead.

Link to comment
Share on other sites

The basic idea is an item that renders the user invisible for x amount of time, use depletes & recharges when not in use.

 

Firstly you are lucky as you can use the invisibilty effect from the stealth boy to achieve the invisiblity effect.

 

After that it really depends on how you want to go about implementing it. I suggest having one item that you would use in your hotkey menu or inventory.

Activating this would equip the player with the item which inturn has the stealth effect attached. The inventory item would have a script attached to have your timer, which would pop-up a menu when the item cannot be worn, it not charged.

 

You would need to have a counter increment the power level when not in use, and decrease it when in use. You would need to check to if the issneaking() on the player and reduce the power to matched the desire rate of either 1 or 1/6 for sneaking.

 

Hopefully that will point you or someone reading this to dev a script.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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