Scripts / change player mode when weapon is activated

Author
Message
Kicsifox
5
Years of Service
User Offline
Joined: 19th Apr 2019
Location: Hungary
Posted: 2nd Nov 2023 16:42
I would like to ask for help:
How is it possible to make it so that when the 3rd person player presses the 1 button and takes out the weapon, it automatically switches to fps. And if 0, then back to 3rd?


I have a 3rd-fps script from this forum (Sorry, I don't remember the author...)

Thank you very much!
D@rkFox

Attachments

Login to view attachments
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Nov 2023 19:06
Change the logic in the script such that instead of triggering the switch on a key press it instead check if the player is carrying a weapon.

GetPlayerWeaponID() will tell you if the player is carrying a weapon.
Been there, done that, got all the T-Shirts!
PM
Kicsifox
5
Years of Service
User Offline
Joined: 19th Apr 2019
Location: Hungary
Posted: 23rd Nov 2023 13:27
Thank you very much, i will try...
D@rkFox
Kicsifox
5
Years of Service
User Offline
Joined: 19th Apr 2019
Location: Hungary
Posted: 4th Apr 2024 20:07
I tried what AmenMoses wrote, but I didn't succeed... The goal would be for the third-person mode to switch to fps when you press the Q key, and for the weapon to be active immediately. If the Q key is pressed again Switch to third person and put the weapon away. I apologize for my bad English...
D@rkFox

Login to post a reply

Server time is: 2024-05-05 18:59:56
Your offset time is: 2024-05-05 18:59:56