
Key RequiredUniversal

-- ====================================================================
-- MM2 GUN SCRIPT FOR DELTA EXECUTOR
-- GUI TITLE: "Made By Willizard"
-- Updated Gun Name: "Matrixscope" in Backpack
-- Features: Clean White Text | Mobile Shiftlock | 2s Dummy Despawn
-- ====================================================================
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local CoreGui = game:GetService("CoreGui")
local LocalPlayer = Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local Camera = workspace.CurrentCamera
-----------------------------------------------------------------------
-- CONFIGURATION
-----------------------------------------------------------------------
local CONFIG = {
GunName = "Matrixscope", -- Đã đổi tên hiển thị trong Backpack
LaserColor = Color3.fromRGB(0, 255, 128),
LaserDuration = 0.2,
Cooldown = 1.2,
ShootSound = "rbxassetid://8561500387",
ReloadSound = "rbxassetid://8561502124",
MeshId = "rbxassetid://5150821217",
TextureId = "rbxassetid://5150821360"
}
-----------------------------------------------------------------------
-- REMOTE EVENT INITIALIZATION
-----------------------------------------------------------------------
local RemoteName = "MM2_SharedGunRemote"
local remoteEvent = ReplicatedStorage:FindFirstChild(RemoteName)
if not remoteEvent then
remoteEvent = Instance.new("RemoteEvent")
remoteEvent.Name = RemoteName
remoteEvent.Parent = ReplicatedStorage
end
-----------------------------------------------------------------------
-- SHIFTLOCK & CAMERA SYSTEM
-----------------------------------------------------------------------
local isShiftLockEnabled = false
local shiftLockConnection = nil
local function toggleShiftLock(enable)
isShiftLockEnabled = enable
if shiftLockConnection then
shiftLockConnection:Disconnect()
shiftLockConnection = nil
end
if isShiftLockEnabled then
shiftLockConnection = RunService.RenderStepped:Connect(function()
local character = LocalPlayer.Character
if character and character:FindFirstChild("HumanoidRootPart") then
local rootPart = character.HumanoidRootPart
local cameraLook = Camera.CFrame.LookVector
local lookVector = Vector3.new(cameraLook.X, 0, cameraLook.Z).Unit
rootPart.CFrame = CFrame.lookAt(rootPart.Position, rootPart.Position + lookVector)
end
end)
end
end
-----------------------------------------------------------------------
-- PRACTICE DUMMY SYSTEM
-----------------------------------------------------------------------
local localDummyModel = nil
local dummyMovementThread = nil
local isDummyMovementEnabled = true
local isDummyJumpEnabled = false
local function stopDummyMovement()
if dummyMovementThread then
task.cancel(dummyMovementThread)
dummyMovementThread = nil
end
end
local function spawnClientDummy()
stopDummyMovement()
if localDummyModel then
localDummyModel:Destroy()
localDummyModel = nil
end
local character = LocalPlayer.Character
if not character or not character:FindFirstChild("HumanoidRootPart") then return end
local hrp = character.HumanoidRootPart
local spawnCFrame = hrp.CFrame * CFrame.new(0, 2, -20)
local dummy = Instance.new("Model")
dummy.Name = "Giant Practice Dummy"
local tag = Instance.new("BoolValue")
tag.Name = "IsClientDummy"
tag.Parent = dummy
local rootPart = Instance.new("Part")
rootPart.Name = "HumanoidRootPart"
rootPart.Size = Vector3.new(5, 5, 2.5)
rootPart.CFrame = spawnCFrame
rootPart.Transparency = 1
rootPart.CanCollide = false
rootPart.Parent = dummy
local torso = Instance.new("Part")
torso.Name = "Torso"
torso.Size = Vector3.new(5, 5, 2.5)
torso.CFrame = spawnCFrame
torso.Color = Color3.fromRGB(40, 40, 40)
torso.Material = Enum.Material.SmoothPlastic
torso.Parent = dummy
local head = Instance.new("Part")
head.Name = "Head"
head.Size = Vector3.new(3, 3, 3)
head.CFrame = spawnCFrame * CFrame.new(0, 4, 0)
head.Color = Color3.fromRGB(0, 255, 128)
head.Material = Enum.Material.Neon
head.Parent = dummy
local rootWeld = Instance.new("WeldConstraint")
rootWeld.Part0 = rootPart
rootWeld.Part1 = torso
rootWeld.Parent = rootPart
local headWeld = Instance.new("WeldConstraint")
headWeld.Part0 = torso
headWeld.Part1 = head
headWeld.Parent = torso
local humanoid = Instance.new("Humanoid")
humanoid.MaxHealth = 100
humanoid.Health = 100
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
humanoid.Parent = dummy
local billboard = Instance.new("BillboardGui")
billboard.Name = "DummyTag"
billboard.Size = UDim2.new(0, 200, 0, 40)
billboard.StudsOffset = Vector3.new(0, 4, 0)
billboard.AlwaysOnTop = true
billboard.Parent = head
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.BackgroundTransparency = 1
textLabel.Text = "[ GIANT PRACTICE DUMMY ]"
textLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
textLabel.Font = Enum.Font.SourceSansBold
textLabel.TextSize = 16
textLabel.Parent = billboard
dummy.PrimaryPart = rootPart
dummy.Parent = workspace
localDummyModel = dummy
dummyMovementThread = task.spawn(function()
while dummy and dummy.Parent and humanoid.Health > 0 do
if isDummyMovementEnabled and rootPart then
local randomOffset = Vector3.new(math.random(-25, 25), 0, math.random(-25, 25))
local targetPos = rootPart.Position + randomOffset
humanoid:MoveTo(targetPos)
if isDummyJumpEnabled and math.random(1, 3) == 1 then
task.wait(math.random(3, 8) / 10)
if humanoid.Health > 0 then
humanoid.Jump = true
end
end
end
task.wait(math.random(2, 4))
end
end)
end
-----------------------------------------------------------------------
-- LASER EFFECT FUNCTION
-----------------------------------------------------------------------
local function drawLaser(origin, endPos)
local distance = (endPos - origin).Magnitude
local laser = Instance.new("Part")
laser.Name = "MM2LaserEffect"
laser.Anchored = true
laser.CanCollide = false
laser.Material = Enum.Material.Neon
laser.Color = CONFIG.LaserColor
laser.Size = Vector3.new(0.15, 0.15, distance)
laser.CFrame = CFrame.lookAt(origin, endPos) * CFrame.new(0, 0, -distance / 2)
laser.Parent = workspace
local tweenInfo = TweenInfo.new(CONFIG.LaserDuration, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local tween = TweenService:Create(laser, tweenInfo, {Transparency = 1, Size = Vector3.new(0, 0, distance)})
tween:Play()
tween.Completed:Connect(function()
laser:Destroy()
end)
end
-----------------------------------------------------------------------
-- EXTERNAL EVENT LISTENER
-----------------------------------------------------------------------
remoteEvent.OnClientEvent:Connect(function(action, data)
if action == "RenderLaser" then
drawLaser(data.Origin, data.EndPos)
elseif action == "KillTarget" then
if data.TargetPlayer == LocalPlayer and LocalPlayer.Character then
local humanoid = LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.Health = 0
end
end
end
end)
-----------------------------------------------------------------------
-- CREATE GUN (TOOL: MATRIXSCOPE)
-----------------------------------------------------------------------
local isReloading = false
local function createMM2Gun()
local tool = Instance.new("Tool")
tool.Name = CONFIG.GunName -- Tên Tool trong Backpack: Matrixscope
tool.GripPos = Vector3.new(0, -0.4, 0.2)
tool.GripForward = Vector3.new(0, 0, -1)
tool.GripRight = Vector3.new(1, 0, 0)
tool.GripUp = Vector3.new(0, 1, 0)
local handle = Instance.new("Part")
handle.Name = "Handle"
handle.Size = Vector3.new(0.8, 1.2, 2.5)
handle.Material = Enum.Material.Neon
handle.Color = Color3.fromRGB(0, 255, 128)
handle.Parent = tool
local mesh = Instance.new("SpecialMesh")
mesh.MeshType = Enum.MeshType.FileMesh
mesh.MeshId = CONFIG.MeshId
mesh.TextureId = CONFIG.TextureId
mesh.Scale = Vector3.new(1, 1, 1)
mesh.Parent = handle
local shootSound = Instance.new("Sound")
shootSound.Name = "ShootSound"
shootSound.SoundId = CONFIG.ShootSound
shootSound.Parent = handle
local reloadSound = Instance.new("Sound")
reloadSound.Name = "ReloadSound"
reloadSound.SoundId = CONFIG.ReloadSound
reloadSound.Parent = handle
tool.Activated:Connect(function()
if isReloading then return end
isReloading = true
shootSound:Play()
local character = LocalPlayer.Character
if not character or not character:FindFirstChild("Head") then
isReloading = false
return
end
local origin = handle.Position
local direction
if isShiftLockEnabled then
direction = Camera.CFrame.LookVector * 500
else
local targetPos = Mouse.Hit.p
direction = (targetPos - origin).Unit * 500
end
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {character}
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
local result = workspace:Raycast(origin, direction, raycastParams)
local endPos = result and result.Position or (origin + direction)
drawLaser(origin, endPos)
remoteEvent:FireServer("RenderLaser", {Origin = origin, EndPos = endPos})
if result and result.Instance then
local hitChar = result.Instance.Parent
if not hitChar:FindFirstChildOfClass("Humanoid") and hitChar.Parent:FindFirstChildOfClass("Humanoid") then
hitChar = hitChar.Parent
end
local targetPlayer = Players:GetPlayerFromCharacter(hitChar)
local targetHumanoid = hitChar:FindFirstChildOfClass("Humanoid")
if targetPlayer and targetPlayer ~= LocalPlayer then
remoteEvent:FireServer("KillTarget", {TargetPlayer = targetPlayer})
elseif targetHumanoid and hitChar:FindFirstChild("IsClientDummy") then
targetHumanoid.Health = 0
stopDummyMovement()
local head = hitChar:FindFirstChild("Head")
if head then head.Color = Color3.fromRGB(255, 50, 50) end
task.delay(2, function()
if hitChar and hitChar.Parent then
hitChar:Destroy()
localDummyModel = nil
end
end)
end
end
task.delay(CONFIG.Cooldown - 0.4, function()
reloadSound:Play()
end)
task.delay(CONFIG.Cooldown, function()
isReloading = false
end)
end)
return tool
end
-----------------------------------------------------------------------
-- GUI SYSTEM: "Made By Willizard"
-----------------------------------------------------------------------
local function setupGUI()
local existingGui = CoreGui:FindFirstChild("WillizardGunGui") or LocalPlayer.PlayerGui:FindFirstChild("WillizardGunGui")
if existingGui then existingGui:Destroy() end
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "WillizardGunGui"
screenGui.ResetOnSpawn = false
pcall(function() screenGui.Parent = CoreGui end)
if not screenGui.Parent then screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui") end
-- MAIN PANEL
local mainPanel = Instance.new("Frame")
mainPanel.Name = "MainPanel"
mainPanel.Size = UDim2.new(0, 200, 0, 250)
mainPanel.Position = UDim2.new(0.02, 0, 0.3, 0)
mainPanel.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
mainPanel.Active = true
mainPanel.Draggable = true
mainPanel.Parent = screenGui
local mainCorner = Instance.new("UICorner")
mainCorner.CornerRadius = UDim.new(0, 8)
mainCorner.Parent = mainPanel
-- TITLE BAR
local titleLabel = Instance.new("TextLabel")
titleLabel.Name = "TitleLabel"
titleLabel.Size = UDim2.new(1, 0, 0, 35)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = "Made By Willizard"
titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
titleLabel.Font = Enum.Font.SourceSansBold
titleLabel.TextSize = 16
titleLabel.Parent = mainPanel
local titleLine = Instance.new("Frame")
titleLine.Size = UDim2.new(0.9, 0, 0, 1)
titleLine.Position = UDim2.new(0.05, 0, 0, 35)
titleLine.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
titleLine.BorderSizePixel = 0
titleLine.Parent = mainPanel
-- BUTTON CONTAINER
local container = Instance.new("Frame")
container.Size = UDim2.new(1, 0, 1, -40)
container.Position = UDim2.new(0, 0, 0, 40)
container.BackgroundTransparency = 1
container.Parent = mainPanel
local layout = Instance.new("UIListLayout")
layout.Padding = UDim.new(0, 8)
layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
layout.SortOrder = Enum.SortOrder.LayoutOrder
layout.Parent = container
-- Helper function to create clean buttons
local function createMenuButton(name, text, order)
local btn = Instance.new("TextButton")
btn.Name = name
btn.Size = UDim2.new(0.88, 0, 0, 32)
btn.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
btn.Text = text
btn.TextColor3 = Color3.fromRGB(255, 255, 255)
btn.Font = Enum.Font.SourceSansBold
btn.TextSize = 13
btn.LayoutOrder = order
btn.Parent = container
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, 6)
corner.Parent = btn
return btn
end
-- CREATE BUTTONS
local spawnBtn = createMenuButton("SpawnBtn", "Spawn Matrixscope", 1)
local shiftBtn = createMenuButton("ShiftBtn", "Shiftlock: OFF", 2)
local dummyBtn = createMenuButton("DummyBtn", "Spawn Dummy", 3)
local moveBtn = createMenuButton("MoveBtn", "Dummy Move: ON", 4)
local jumpBtn = createMenuButton("JumpBtn", "Dummy Jump: OFF", 5)
-- CENTER CROSSHAIR
local crosshair = Instance.new("Frame")
crosshair.Name = "Crosshair"
crosshair.Size = UDim2.new(0, 6, 0, 6)
crosshair.Position = UDim2.new(0.5, -3, 0.5, -3)
crosshair.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
crosshair.Visible = false
crosshair.Parent = screenGui
local crossCorner = Instance.new("UICorner")
crossCorner.CornerRadius = UDim.new(1, 0)
crossCorner.Parent = crosshair
-- MINIMIZE / TOGGLE MENU BUTTON
local toggleBtn = Instance.new("TextButton")
toggleBtn.Name = "ToggleMenuBtn"
toggleBtn.Size = UDim2.new(0, 110, 0, 30)
toggleBtn.Position = UDim2.new(0.02, 0, 0.23, 0)
toggleBtn.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
toggleBtn.Text = "Willizard Menu"
toggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
toggleBtn.Font = Enum.Font.SourceSansBold
toggleBtn.TextSize = 12
toggleBtn.Active = true
toggleBtn.Draggable = true
toggleBtn.Parent = screenGui
local toggleCorner = Instance.new("UICorner")
toggleCorner.CornerRadius = UDim.new(0, 6)
toggleCorner.Parent = toggleBtn
toggleBtn.MouseButton1Click:Connect(function()
mainPanel.Visible = not mainPanel.Visible
end)
-- EVENT LOGIC LISTENERS
spawnBtn.MouseButton1Click:Connect(function()
local backpack = LocalPlayer:FindFirstChildOfClass("Backpack")
if backpack then
if backpack:FindFirstChild(CONFIG.GunName) or (LocalPlayer.Character and LocalPlayer.Character:FindFirstChild(CONFIG.GunName)) then
return
end
local gun = createMM2Gun()
gun.Parent = backpack
end
end)
shiftBtn.MouseButton1Click:Connect(function()
local newState = not isShiftLockEnabled
toggleShiftLock(newState)
if newState then
shiftBtn.Text = "Shiftlock: ON"
crosshair.Visible = true
else
shiftBtn.Text = "Shiftlock: OFF"
crosshair.Visible = false
end
end)
dummyBtn.MouseButton1Click:Connect(function()
spawnClientDummy()
end)
moveBtn.MouseButton1Click:Connect(function()
isDummyMovementEnabled = not isDummyMovementEnabled
if isDummyMovementEnabled then
moveBtn.Text = "Dummy Move: ON"
else
moveBtn.Text = "Dummy Move: OFF"
end
end)
jumpBtn.MouseButton1Click:Connect(function()
isDummyJumpEnabled = not isDummyJumpEnabled
if isDummyJumpEnabled then
jumpBtn.Text = "Dummy Jump: ON"
else
jumpBtn.Text = "Dummy Jump: OFF"
end
end)
end
setupGUI()No comments yet for this script.



