Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Lowering delay time on firing RemoteEvents?

Asked by
gitrog 326 Moderation Voter
6 years ago

So, I have an automatic gun, and every time it fires a bullet it sends a RemoteEvent to fire the bullet. Thing is, it fires pretty slow, and I can fire faster on semi. How would I lessen the delay?

I have it set to 0 because I want it to be as fast as possible, but it doesn't seem to care.

--Code fragment.
mouse.Button1Down:Connect(function()
        if automaticFire and cooldown == false then
            mouseDown = true
            while mouseDown and automaticFire do
                if scriptLoaded > 0 and lowered == false then
                    if fireRate > 0 then
                        cooldown = true     
                    end         
                    scriptLoaded = scriptLoaded - 1
                    player.PlayerGui.ammoDisplay.Frame.ammo.Text = scriptLoaded .. "/" .. scriptUnloaded
                    fireBullet()
                    cooldown = false
                else
                    mouseDown = false
                    local emptyChamber = Instance.new("Sound")
                    emptyChamber.Parent = tool.firePart
                    emptyChamber.SoundId = "http://www.roblox.com/asset/?id=" .. gunEmpty
                    emptyChamber:Play()
                    wait(1)
                    emptyChamber:Destroy()
                end
            end
end
0
You cannot. The signals on your computer and ROBLOX's servers is trying to travel as fast as they can. Unless you have magic, you cannot speed this up. hiimgoodpack 2009 — 6y
0
Alright. Any ideas how other gun scripts make them fire so fast then? gitrog 326 — 6y
0
They could fire the remote event once and have the script fire 5 times every remote event fire hiimgoodpack 2009 — 6y
0
or just don use a remove event R_alatch 394 — 6y
0
I mean, what else am I supposed to do? It's FilteringEnabled, and it's firing from a LocalScript. It won't do anything without a RemoteEvent. gitrog 326 — 6y

Answer this question