-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScript
More file actions
130 lines (112 loc) · 4.48 KB
/
Script
File metadata and controls
130 lines (112 loc) · 4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
--// MM2 GUI with ESP Toggle & Shoot Button (Delta Executor Ready)
if game.PlaceId ~= 142823291 then
warn("Not in MM2.")
return
end
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local RunService = game:GetService("RunService")
local Camera = workspace.CurrentCamera
-- GUI Setup
local gui = Instance.new("ScreenGui", game.CoreGui)
-- ESP Toggle UI
local espFrame = Instance.new("Frame", gui)
espFrame.Size = UDim2.new(0, 160, 0, 40)
espFrame.Position = UDim2.new(0, 30, 0, 150)
espFrame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
espFrame.BorderSizePixel = 0
espFrame.Active = true
espFrame.Draggable = true
local espLabel = Instance.new("TextLabel", espFrame)
espLabel.Size = UDim2.new(0.6, 0, 1, 0)
espLabel.Text = "ESP:"
espLabel.BackgroundTransparency = 1
espLabel.TextColor3 = Color3.new(1, 1, 1)
espLabel.TextScaled = true
local espToggle = Instance.new("TextButton", espFrame)
espToggle.Position = UDim2.new(0.6, 5, 0.2, 0)
espToggle.Size = UDim2.new(0.35, 0, 0.6, 0)
espToggle.BackgroundColor3 = Color3.fromRGB(100, 0, 0)
espToggle.Text = "OFF"
espToggle.TextColor3 = Color3.new(1,1,1)
espToggle.TextScaled = true
-- Shoot Button
local shootBtn = Instance.new("TextButton", gui)
shootBtn.Size = UDim2.new(0, 160, 0, 40)
shootBtn.Position = UDim2.new(0, 30, 0, 200)
shootBtn.Text = "Shoot Murderer"
shootBtn.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
shootBtn.TextColor3 = Color3.new(1, 1, 1)
shootBtn.TextScaled = true
shootBtn.Active = true
shootBtn.Draggable = true
-- ESP Logic
local espEnabled = false
local espLoop
local function setESP(state)
espEnabled = state
if state then
espToggle.Text = "ON"
espToggle.BackgroundColor3 = Color3.fromRGB(0, 150, 0)
espLoop = RunService.RenderStepped:Connect(function()
for _, plr in ipairs(Players:GetPlayers()) do
if plr ~= LocalPlayer and plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") then
local esp = plr.Character:FindFirstChild("ESP")
if not esp then
esp = Instance.new("Highlight", plr.Character)
esp.Name = "ESP"
esp.OutlineColor = Color3.new(0, 0, 0)
end
local hasKnife = plr.Backpack:FindFirstChild("Knife") or plr.Character:FindFirstChild("Knife")
local hasGun = plr.Backpack:FindFirstChild("Gun") or plr.Character:FindFirstChild("Gun")
if hasKnife then
esp.FillColor = Color3.new(1, 0, 0)
elseif hasGun then
esp.FillColor = Color3.new(0, 0.5, 1)
else
esp.FillColor = Color3.new(1, 1, 1)
end
end
end
end)
else
espToggle.Text = "OFF"
espToggle.BackgroundColor3 = Color3.fromRGB(100, 0, 0)
if espLoop then espLoop:Disconnect() end
for _, plr in ipairs(Players:GetPlayers()) do
if plr.Character and plr.Character:FindFirstChild("ESP") then
plr.Character.ESP:Destroy()
end
end
end
end
espToggle.MouseButton1Click:Connect(function()
setESP(not espEnabled)
end)
-- Shoot Button Logic
shootBtn.MouseButton1Click:Connect(function()
local char = LocalPlayer.Character
local gun = char and char:FindFirstChild("Gun")
if not gun then return end
for _, plr in ipairs(Players:GetPlayers()) do
if plr ~= LocalPlayer and plr.Character then
local knife = plr.Backpack:FindFirstChild("Knife") or plr.Character:FindFirstChild("Knife")
local hrp = plr.Character:FindFirstChild("HumanoidRootPart")
if knife and hrp then
-- Line of sight check
local origin = Camera.CFrame.Position
local direction = (hrp.Position - origin).Unit * 999
local rayParams = RaycastParams.new()
rayParams.FilterDescendantsInstances = {LocalPlayer.Character}
rayParams.FilterType = Enum.RaycastFilterType.Blacklist
local result = workspace:Raycast(origin, direction, rayParams)
if result and result.Instance and result.Instance:IsDescendantOf(plr.Character) then
game.ReplicatedStorage.Remotes.ShootGun:FireServer(hrp.Position)
break
end
end
end
end
end)
-- Optional: turn on ESP by default
setESP(true)