Skip to content

๐Ÿ–๏ธ BLN RPS Game โ€‹

bln Rock Paper Scissors game - RedM

๐Ÿ“บ Preview โ€‹

Video Preview

๐Ÿ’ฐ Buy Now โ€‹

Get it now

Add an interactive Rock Paper Scissors game to your RedM server! Challenge nearby players to quick matches with animations, create engaging social interactions, and customize the game outcomes for your server's needs.

โœจ Features โ€‹

  • ๐ŸŽฏ Proximity-based player challenges
  • ๐ŸŽญ Synchronized animations for all players
  • ๐Ÿ’ซ Sleek UI for game choices
  • ๐Ÿ”„ Automatic round system for ties
  • โšก Built-in cooldown system
  • ๐Ÿ›ก๏ธ Anti-spam protection
  • ๐ŸŽจ Customizable notifications
  • ๐Ÿ“Š Developer API for game outcomes

Dependencies โ€‹

โš™๏ธ Installation โ€‹

  1. Download the latest release
  2. Extract the files to your server's resource folder
  3. Add ensure bln_rps_game to your server.cfg
  4. Configure the settings in config.lua to your liking
  5. Restart your server

๐ŸŽฎ Usage โ€‹

The game can be initiated using:

  • /rps - Starts a game request with a nearby player (within configured proximity)

Game Flow:

  1. Player uses command near another player
  2. Target player receives request notification
  3. If accepted, both players see the choice UI
  4. Players make their choices
  5. Animations play and results are shown
  6. Game either continues (tie) or ends with a winner

๐Ÿ› ๏ธ Configuration โ€‹

The config.lua file allows you to customize various aspects of the game:

lua
Config = {
    Settings = {
        command = "rps",              -- Command to start the game
        proximityDistance = 3.0,      -- Distance to detect nearby players
        animationDelay = 3000,        -- Delay before showing animations
        resultDelay = 1000,          -- Delay before showing results
        cooldownTime = 60,           -- Seconds before playing again
        enableCooldown = true,       -- Enable/disable cooldown system
        defaultDuration = 7000       -- Default notification duration
    },
    
    -- Customize all notification messages
    Notifications = {
        alreadyInGame = {
            title = "Game in Progress",
            description = "You are already in a game!",
            placement = "middle-right",
            type = "ERROR"
        },
        -- More notification configurations...
    },

    -- Customize result messages
    ResultMessages = {
        win = "You won! Your opponent chose %s",
        lose = "You lost! Your opponent chose %s",
        tie = "It's a tie! Both chose %s. Playing another round!"
    }
}

๐Ÿ’ป Developer API โ€‹

Export Functions โ€‹

lua
-- Get all active games
exports.bln_rps_game:GetActiveGames()

-- Check if a player is in game
exports.bln_rps_game:IsPlayerInGame(playerId)

Game Finished Event โ€‹

The script fires a server event when each game concludes that you can listen to in any resource:

lua
-- shared/custom.lua
RegisterNetEvent('bln_rps_game:gameFinished')
AddEventHandler('bln_rps_game:gameFinished', function(winner, loser, winnerChoice, loserChoice) 
    -- Add your custom logic here
    -- Examples:
    -- - Give rewards to winner
    -- - Track statistics
    -- - Trigger other game systems
    -- - Add gambling functionality
end)

Example: Adding Rewards โ€‹

lua
-- shared/custom.lua
RegisterNetEvent('bln_rps_game:gameFinished')
AddEventHandler('bln_rps_game:gameFinished', function(winner, loser, winnerChoice, loserChoice) 
    -- Example: Give winner 10 cash
    exports.framework:giveCash(winner, 10)
    
    -- Example: Track wins in database
    exports.framework:updatePlayerStats(winner, 'rps_wins')
end)

๐Ÿ”ง Technical Details โ€‹

UI System โ€‹

  • Clean HTML/CSS interface for player choices
  • Responsive design with hover effects
  • Easy to customize appearance

Cooldown System โ€‹

  • Prevents spam and abuse
  • Configurable duration
  • Server-side validation
  • Automatic cleanup of expired cooldowns

๐Ÿค Support โ€‹

Need help? Have questions? Join our Discord server for support and updates!

  • ๐Ÿ’ฌ Discord: Join Here
  • ๐ŸŽฎ Live support and community help
  • ๐Ÿ”„ Regular updates and improvements