Posts
1,864
Respect
330Add +1
Forum Rank
Zombie Destroyer
Primary Group
Community Mapper
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!Aye mate you don't know me so y don't you shut tf up ok buddy
Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. | |
Box Mappers Elite | |
Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. | |
Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
I am working on a Dual Mag script which appears to be working but I've run into an issue.
When it came to playing a different anim when they had 0 bullets I decided to use forceviewmodelanimation and set it to reload, which would be the dual_mag_empty anim.
It works, but for some reason after it switches back to my original weapon I can't shoot for 1 or so seconds.
This is the script:
Shooting and reloading when there is ammo in weapon works no issues, but if it's reloading empty with the dual mag anim, it freezes the gun for a few seconds.
Any info would be appreciated, if I can't get it to work I can just use same dual mag anim.
Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. | |
Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. | |
Box Mappers Elite | |
Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. | |
Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
If you switch weapon to fast after playing a forced animation with ForceViewModelAnimation, it freezes the gun up and waits the reload time all over again. For those wait times you added, add 0.05 to them so it has a nice extra frame of time to finish the animation. Also for your reload wait times, don't forget to account for speed cola.Your script also looks like you can switch from 'k7' but still have this work. You have to constantly check that your current weapon is the k7, you cannot just wait until reload start because the player might have switched from it during that time.
Here I made a little script you could try that fixes what I just mentioned:BTW this script is actually pretty smart. Mind if I use it?
Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. | |
Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
Thanks, nice to know that when I use forceviewmodelanimation again, lol. and thanks for making the edits for me.
I forgot to add it to the bottom of this, but with anything I post in this section when asking for help, anyone is more than welcome to use this stuff and apply it to what they want.
Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. | |
Box Mappers Elite | |
Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. | |
Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
K thanks. I made some changes after the first time I posted this script, can I see the script that you are using right now to make sure it is right?
Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. | |
Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
Sure, I made some edits but nothing major, just made it so I can call it with add_dual_mag_weapon(); and check their weapon so they can't switch to the alt weapon:
I did notice however, that if they have speed cola, it can freeze again, and if they are reloading they can switch back to their original. According to DUKIP it is not possible to override this at all. I just need to rely on them not pressing 5.
Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. | |
Box Mappers Elite | |
Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. | |
Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
Or you can dowhile reloading and then to re-enable alt weapon switching when done. Also if you are making multiple weapons, I would suggest making an array for self.dual_mag_reloads, so each weapon would have self.dual_mag_reloads[ weapon ].
Here I made some changes for you again, this time I also made it set the ammo to the weapon's clip size rather than just '30' as not all guns have a clip size of 30. I also added the alt weapon switch disable instead of your 'is_alt' function. I used a little something I got from origins staffs scripts that was used to manage the "fake" alt weapon that was the revive staff, but heavily edited to fit for this. Basically it just handles some logic about when to allow or disallow alt weapon switching, so that it doesn't break other gun's alt weapons. You also said that if the player has speed cola, it still freezes? I put the weapon reload times back to their default and manually added +0.05 in the reload time multiplier for speed cola.Also I realized that if you have speed cola, and you use the alt raise animation like you have been doing to play the animation, speed cola will not speed that up. I'm tired right now so maybe make sure this works first and I will think of a way to speed up the normal reload time w/ speed cola and script it for you, only because I want to use this too and I don't mind who else uses it because I don't like seeing fake dual mags like I have before. Infact, if you confirm it works, could I make a tutorial in the scripts section?