Closed Mart475 closed 4 years ago
Attempted to resolve in https://github.com/inferno-collection/Weapons/commit/782f5a37c4b28685d9dc4538b59c5bf9d3330582.
I have build 782f5a3 on my server and it seems that some players are unable to turn on the flashlight. It clicks but they do not see it.
Update: I TPed to the player, turned on my light, and now he can see it. It seems whenever I turn on my light his updates (aka he can turn it on or off) but if I don't turn it on or off, he can't toggle it
Update 2: Removed:
if not LastCount then LastCount = #Flashlights end
if #Flashlights ~= LastCount then LastCount = #Flashlights end
and kept
TriggerClientEvent('Weapons:Client:Return', -1, Flashlights)
fixes the issue
Thanks for the feedback, that was an experiment to see if we could reduce the spam sent to the client, clearly it's not working lol.
Thanks, I'll change it
Attempted to resolve in https://github.com/inferno-collection/Weapons/commit/e6479b626409e64852ce61c9a1e967e62276e5b7.
Resolved in Public Beta Version 1.3.
https://github.com/inferno-collection/Weapons/releases/tag/v1.3-beta
The flashlight has multiple issues, and these center around turning it on/off.
When you spam the E button to turn it on/off, it sometimes gets stuck and doesn't want to turn on/off. This was fixed by adding a delay in this loop below.
-- Toggle Weapon Flashlight Loop Citizen.CreateThread(function() while true do Citizen.Wait(0)
end)
Citizen.Wait(100) under PlaySoundFrontend.
It could be increased and it actually stops it from happening.
Another small issue with the script is sometimes the default vanilla flashlight goes on, as the script's master loop loops every 1ms and if you time it perfectly, it can get stuck on and you can't turn it off except switiching weapons.
Was in a call with the creator and we managed to fix one of the issues, but he said that the vanilla flashlight turning on/off is probably just the disable bit being in the master loop, and it needs to be somewhere else. Please fix. Thanks :)