Advertisement
AERQ1111

Canadian Simulator Unlimited Ammo Script

Apr 6th, 2025 (edited)
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.35 KB | None | 0 0
  1. -- Canadian Simulator Unlimited Ammo Script (v2, WIP)
  2. local Players = game:GetService("Players")
  3. local UserInputService = game:GetService("UserInputService")
  4. local LocalPlayer = Players.LocalPlayer
  5.  
  6. -- Remove old gui
  7. local function removeOldGUI()
  8.     if LocalPlayer:FindFirstChild("PlayerGui") then
  9.         local existingGUI = LocalPlayer.PlayerGui:FindFirstChild("ReadyToFireGUI")
  10.         if existingGUI then
  11.             existingGUI:Destroy()
  12.         end
  13.     end
  14. end
  15.  
  16. local function setupScript()
  17.     removeOldGUI() -- Remove old GUI before creating a new one
  18.    
  19.     local Backpack = LocalPlayer:WaitForChild("Backpack")
  20.  
  21.     -- UI Setup
  22.     local ScreenGui = Instance.new("ScreenGui")
  23.     ScreenGui.Name = "ReadyToFireGUI"
  24.     ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
  25.     ScreenGui.ResetOnSpawn = false
  26.  
  27.     local Frame = Instance.new("Frame")
  28.     Frame.Size = UDim2.new(0, 200, 0, 50)
  29.     Frame.Position = UDim2.new(0.5, -100, 0.1, 0)
  30.     Frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  31.     Frame.BorderSizePixel = 2
  32.     Frame.BorderColor3 = Color3.fromRGB(255, 255, 255)
  33.     Frame.Active = true -- Enable Dragging
  34.     Frame.Draggable = true -- GUI Draggable Feature
  35.     Frame.Parent = ScreenGui
  36.  
  37.     local TextLabel = Instance.new("TextLabel")
  38.     TextLabel.Size = UDim2.new(1, 0, 1, 0)
  39.     TextLabel.BackgroundTransparency = 1
  40.     TextLabel.Font = Enum.Font.SourceSansBold
  41.     TextLabel.TextSize = 20
  42.     TextLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
  43.     TextLabel.Text = "[ReadyToFire: OFF]"
  44.     TextLabel.Parent = Frame
  45.  
  46.     -- Fading Animation
  47.     local function fadeEffect()
  48.         while true do
  49.             for i = 0, 1, 0.05 do
  50.                 Frame.BackgroundColor3 = Color3.new(0, 0, 0):Lerp(Color3.fromRGB(20, 20, 20), i)
  51.                 wait(0.05)
  52.             end
  53.             for i = 1, 0, -0.05 do
  54.                 Frame.BackgroundColor3 = Color3.new(0, 0, 0):Lerp(Color3.fromRGB(20, 20, 20), i)
  55.                 wait(0.05)
  56.             end
  57.         end
  58.     end
  59.  
  60.     -- variable
  61.     local enabled = false
  62.  
  63.     -- Keep turning on ReadyToFire (THIS USED TO TOGGLE READYTOFIRE CONTINUOUSLY, BUT NOW YOU HAVE TO RE-EQUIP TO RELOAD)
  64.     local function forceReadyToFire()
  65.         while enabled do
  66.             for _, tool in ipairs(Backpack:GetChildren()) do
  67.                 if tool:IsA("Tool") and tool:FindFirstChild("GunValues") then
  68.                     local gunValues = tool.GunValues
  69.                     local readyToFire = gunValues:FindFirstChild("ReadyToFire")
  70.                     if readyToFire and readyToFire:IsA("BoolValue") then
  71.                         readyToFire.Value = true
  72.                     end
  73.                 end
  74.             end
  75.             TextLabel.Text = "[ReadyToFire: ON]"
  76.             TextLabel.TextColor3 = Color3.fromRGB(0, 255, 0)
  77.             wait(0.1)
  78.         end
  79.     end
  80.  
  81.     -- Toggle ReadyToFire
  82.     local function toggleReadyToFire()
  83.         enabled = not enabled -- Toggle the state
  84.  
  85.         if enabled then
  86.             spawn(forceReadyToFire)
  87.         else
  88.             TextLabel.Text = "[ReadyToFire: OFF]"
  89.             TextLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
  90.         end
  91.     end
  92.  
  93.     -- Keybind to Toggle script ("[" Left Bracket)
  94.     UserInputService.InputBegan:Connect(function(input, gameProcessed)
  95.         if not gameProcessed and input.KeyCode == Enum.KeyCode.LeftBracket then -- Adjustable
  96.             toggleReadyToFire()
  97.         end
  98.     end)
  99.  
  100.     -- Scan for new tools in yuor backpack
  101.     Backpack.ChildAdded:Connect(function(tool)
  102.         wait(0.1) -- Short delay
  103.         if enabled then
  104.             spawn(forceReadyToFire())
  105.         end
  106.     end)
  107.  
  108.     spawn(fadeEffect)
  109. end
  110.  
  111. setupScript()
  112.  
  113. -- Turn on script again after respawning
  114. LocalPlayer.CharacterAdded:Connect(function()
  115.     wait(1) -- Short delay for your character to loading
  116.     setupScript()
  117. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement