Fireworks Script

Fireworks Script for the New Year


Code is accessible Yes
Subscription-based No
Lines (approximately) 150
Support Yes

Download

4 Likes

Any more information on this? Can we move where the fireworks are set off? Can we change the fireworks that happen and when they happen?

Yes, the code is accessible, you can change the coords of each position and you can disable a specific position in config.lua

1 Like

Great, thanks!

Great Release!

If anyone wants to toggle the fireworks by command :slight_smile:

RegisterCommand("stopfw", function(source, args, rawCommand)
    -- If the source is > 0, then that means it must be a player.
    if (source > 0) then
           print('Stoped Fireworks')
            for _, playerId in ipairs(GetPlayers()) do
                TriggerClientEvent("lhdc_fogoArtificio:stop", playerId)
            end
    -- If it's not a player, then it must be RCON, a resource, or the server console directly.
    else
        print("This command was executed by the server console, RCON client, or a resource.")
    end
end, false --[[this command is not restricted, everyone can use this.]])


RegisterCommand("startfw", function(source, args, rawCommand)
    -- If the source is > 0, then that means it must be a player.
    if (source > 0) then
            print('Started Fireworks')
            for _, playerId in ipairs(GetPlayers()) do
                TriggerClientEvent("lhdc_fogoArtificio:start", playerId)
            end
    -- If it's not a player, then it must be RCON, a resource, or the server console directly.
    else
        print("This command was executed by the server console, RCON client, or a resource.")
    end
end, false --[[this command is not restricted, everyone can use this.]])

Instead of doing this:

for _, playerId in ipairs(GetPlayers()) do
    TriggerClientEvent("lhdc_fogoArtificio:start", playerId)
end

Do this:

TriggerClientEvent("lhdc_fogoArtificio:start", -1)
3 Likes

@RobijnFox @OKCRP you can create a pull request in github