Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Canadian Simulator Unlimited Ammo Script (v2, WIP)
- local Players = game:GetService("Players")
- local UserInputService = game:GetService("UserInputService")
- local LocalPlayer = Players.LocalPlayer
- -- Remove old gui
- local function removeOldGUI()
- if LocalPlayer:FindFirstChild("PlayerGui") then
- local existingGUI = LocalPlayer.PlayerGui:FindFirstChild("ReadyToFireGUI")
- if existingGUI then
- existingGUI:Destroy()
- end
- end
- end
- local function setupScript()
- removeOldGUI() -- Remove old GUI before creating a new one
- local Backpack = LocalPlayer:WaitForChild("Backpack")
- -- UI Setup
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Name = "ReadyToFireGUI"
- ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
- ScreenGui.ResetOnSpawn = false
- local Frame = Instance.new("Frame")
- Frame.Size = UDim2.new(0, 200, 0, 50)
- Frame.Position = UDim2.new(0.5, -100, 0.1, 0)
- Frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- Frame.BorderSizePixel = 2
- Frame.BorderColor3 = Color3.fromRGB(255, 255, 255)
- Frame.Active = true -- Enable Dragging
- Frame.Draggable = true -- GUI Draggable Feature
- Frame.Parent = ScreenGui
- local TextLabel = Instance.new("TextLabel")
- TextLabel.Size = UDim2.new(1, 0, 1, 0)
- TextLabel.BackgroundTransparency = 1
- TextLabel.Font = Enum.Font.SourceSansBold
- TextLabel.TextSize = 20
- TextLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
- TextLabel.Text = "[ReadyToFire: OFF]"
- TextLabel.Parent = Frame
- -- Fading Animation
- local function fadeEffect()
- while true do
- for i = 0, 1, 0.05 do
- Frame.BackgroundColor3 = Color3.new(0, 0, 0):Lerp(Color3.fromRGB(20, 20, 20), i)
- wait(0.05)
- end
- for i = 1, 0, -0.05 do
- Frame.BackgroundColor3 = Color3.new(0, 0, 0):Lerp(Color3.fromRGB(20, 20, 20), i)
- wait(0.05)
- end
- end
- end
- -- variable
- local enabled = false
- -- Keep turning on ReadyToFire (THIS USED TO TOGGLE READYTOFIRE CONTINUOUSLY, BUT NOW YOU HAVE TO RE-EQUIP TO RELOAD)
- local function forceReadyToFire()
- while enabled do
- for _, tool in ipairs(Backpack:GetChildren()) do
- if tool:IsA("Tool") and tool:FindFirstChild("GunValues") then
- local gunValues = tool.GunValues
- local readyToFire = gunValues:FindFirstChild("ReadyToFire")
- if readyToFire and readyToFire:IsA("BoolValue") then
- readyToFire.Value = true
- end
- end
- end
- TextLabel.Text = "[ReadyToFire: ON]"
- TextLabel.TextColor3 = Color3.fromRGB(0, 255, 0)
- wait(0.1)
- end
- end
- -- Toggle ReadyToFire
- local function toggleReadyToFire()
- enabled = not enabled -- Toggle the state
- if enabled then
- spawn(forceReadyToFire)
- else
- TextLabel.Text = "[ReadyToFire: OFF]"
- TextLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
- end
- end
- -- Keybind to Toggle script ("[" Left Bracket)
- UserInputService.InputBegan:Connect(function(input, gameProcessed)
- if not gameProcessed and input.KeyCode == Enum.KeyCode.LeftBracket then -- Adjustable
- toggleReadyToFire()
- end
- end)
- -- Scan for new tools in yuor backpack
- Backpack.ChildAdded:Connect(function(tool)
- wait(0.1) -- Short delay
- if enabled then
- spawn(forceReadyToFire())
- end
- end)
- spawn(fadeEffect)
- end
- setupScript()
- -- Turn on script again after respawning
- LocalPlayer.CharacterAdded:Connect(function()
- wait(1) -- Short delay for your character to loading
- setupScript()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement