Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getgenv().toggled = true --/ true & false
- getgenv().old = getgenv().old or require(game:GetService("ReplicatedStorage").Module.RayCast).RayIgnoreNonCollideWithIgnoreList
- if getgenv().toggled then
- local glowingParts = {}
- local glowingColor = Color3.fromRGB(0, 255, 0) -- Modify this color as desired
- require(game:GetService("ReplicatedStorage").Module.RayCast).RayIgnoreNonCollideWithIgnoreList = function(...)
- local nearestDistance, nearestEnemy = 1000, nil
- for i,v in pairs(game:GetService("Players"):GetPlayers()) do
- if v.Team ~= game:GetService("Players").LocalPlayer.Team and v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
- if (v.Character.HumanoidRootPart.Position - game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position).Magnitude < nearestDistance then
- nearestDistance, nearestEnemy = (v.Character.HumanoidRootPart.Position - game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position).Magnitude, v
- end
- end
- end
- local arg = {old(...)}
- if (tostring(getfenv(2).script) == "BulletEmitter" or tostring(getfenv(2).script) == "Taser") then
- for player, glow in pairs(glowingParts) do
- if player ~= nearestEnemy then
- glow:Remove()
- glowingParts[player] = nil
- end
- end
- if nearestEnemy then
- arg[1] = nearestEnemy.Character.HumanoidRootPart
- arg[2] = nearestEnemy.Character.HumanoidRootPart.Position
- -- Make the HumanoidRootPart of the target glow
- if not glowingParts[nearestEnemy] then
- local glow = Instance.new("PointLight")
- glow.Color = glowingColor
- glow.Range = 10
- glow.Brightness = 5
- glow.Parent = nearestEnemy.Character.HumanoidRootPart
- glowingParts[nearestEnemy] = glow
- -- Add a tag to the target to display their name
- local tag = Instance.new("BillboardGui")
- tag.Size = UDim2.new(0, 100, 0, 20)
- tag.Adornee = nearestEnemy.Character.HumanoidRootPart
- tag.Parent = nearestEnemy.Character.HumanoidRootPart
- local text = Instance.new("TextLabel")
- text.Size = UDim2.new(1, 0, 1, 0)
- text.BackgroundTransparency = 1
- text.Text = nearestEnemy.Name
- text.TextColor3 = glowingColor
- text.Parent = tag
- end
- end
- end
- return unpack(arg)
- end
- else
- require(game:GetService("ReplicatedStorage").Module.RayCast).RayIgnoreNonCollideWithIgnoreList = getgenv().old
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement