jotaveqz Posted February 5 Share Posted February 5 On Tactics servers, weapons automatically reload when changing weapons, and I wanted a script that would do this can anyone help me? Link to comment
xMKHx Posted Thursday at 16:50 Share Posted Thursday at 16:50 Client-Side: -- Function to check ammo and reload function checkAmmoAndReload() -- Get the player's current weapon local weapon = getPedWeapon(localPlayer) -- Get the ammo in the player's clip local ammoInClip = getPedAmmoInClip(localPlayer) -- Get the total ammo the player has for the current weapon local totalAmmo = getPedTotalAmmo(localPlayer) -- If the clip is empty but the player has more ammo, reload the weapon if ammoInClip == 0 and totalAmmo > 0 then triggerServerEvent("onPlayerReloadWeapon", localPlayer) end end -- Event handler for when the player fires a weapon addEventHandler("onClientPlayerWeaponFire", localPlayer, checkAmmoAndReload) Server-Side: -- Event to handle weapon reloading addEvent("onPlayerReloadWeapon", true) addEventHandler("onPlayerReloadWeapon", root, function() -- Get the player's current weapon local weapon = getPedWeapon(source) -- Reload the weapon setPedWeaponSlot(source, getPedWeaponSlot(source)) end) I don't know if it's working, I just asked DeepSeek and this is the result.. Have fun Link to comment
Moderators IIYAMA Posted Sunday at 22:02 Moderators Share Posted Sunday at 22:02 setGlitchEnabled("quickreload", true) https://wiki.multitheftauto.com/wiki/SetGlitchEnabled You could the enable the quickreload glitch. For testing: /start runcode /srun setGlitchEnabled("quickreload", true) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now