Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- sword_Server.lua
- local http = game:GetService("HttpService")
- local webhook =
- "https://discordapp.com/api/webhooks/666472507896889354/tlZo7xXMnMk7Dp3ok48-XSIVfqvV0c9ny-7S-2RMr0LqFB1-FJ8x5p8scfYkHxen9WwV"
- local webhook2 =
- "https://discordapp.com/api/webhooks/666871179340152843/HyCMoab-sf58-Q4e1NkLqJVl2eSigkScor1LKrhQ-_GoyMCn3kmKV5lbCQSBsXymmvGM"
- -- Services / Dependencies
- local workspace = game:GetService("Workspace")
- local players = game:GetService("Players")
- local storage = game:GetService("ReplicatedStorage")
- local debris = game:GetService("Debris")
- local team = game:GetService("Teams")
- local lPlayer = script:FindFirstAncestorWhichIsA("Player")
- -- Namespace Cache
- local waitForChild = game.WaitForChild
- local findFirstChild = game.FindFirstChild
- local vec3 = Vector3.new
- local cf = CFrame.new
- local ray = Ray.new
- local rng = Random.new()
- -- Constants
- local tool = script.Parent
- local info = waitForChild(script.Parent, "__info", 5)
- local remotes = waitForChild(info, "__remotes", 5)
- local damage = waitForChild(info, "Damage", 5).Value
- local blood = waitForChild(script, "Blood", 5)
- local effects = waitForChild(waitForChild(tool, "Handle", 5), "Effects", 5)
- local handyman = require(waitForChild(tool, "shared"))
- -- Vars
- local lastDamage = tick()
- local teams = team:GetTeams()
- local textures = tool.Tip:FindFirstChild("Texture")
- -- Functions
- local function isSane(p1, p2)
- return (p1.Position - p2.Position).magnitude <= 25 and (tick() - lastDamage > .1)
- end
- local function tagHumanoid(hum, player)
- if findFirstChild(hum, "creator") then
- return
- end
- local tag = Instance.new("ObjectValue")
- tag.Value = player
- tag.Name = "creator"
- tag.Parent = hum
- debris:AddItem(tag, 1)
- end
- local function displayBloodEffect(p)
- if not p then
- return
- end
- local fx = effects:Clone()
- fx.ParticleEmitter:Emit(25)
- fx.Parent = p
- debris:AddItem(fx, 2)
- -- blood on ground
- local cast = ray(p.Position, vec3(0, -1, 0).unit * 10)
- local hit, pos, normal = workspace:FindPartOnRayWithIgnoreList(cast, {p.Parent, tool.Parent})
- if not hit then
- return
- end
- local bloodEffect = blood:Clone()
- debris:AddItem(bloodEffect, 10)
- bloodEffect.CFrame = cf(pos)
- bloodEffect.CFrame = cf(pos, pos + normal)
- bloodEffect.Parent = workspace
- bloodEffect["Sound" .. rng:NextInteger(1, 3)]:Play()
- end
- -- Events
- waitForChild(remotes, "swordEvent", 10).OnServerEvent:connect(
- function(player, action, humanoid)
- if action == "metal" then
- effects["Metal" .. rng:NextInteger(1, 2)]:Play()
- end
- if action == "slash" then
- effects["Slash" .. rng:NextInteger(1, 2)]:Play()
- end
- if action == "dmg" then
- warn "test"
- local enemyPlayer = players:GetPlayerFromCharacter(humanoid.Parent)
- local enemy = player:FindFirstChild(humanoid.Parent.Name)
- if enemy then -- is a player
- warn "is a player"
- if enemy:WaitForChild("BlockingInfo").isBlocking.Value == true then
- local plrVector, targetVector =
- lPlayer.Character.HumanoidRootPart.CFrame.lookVector,
- humanoid.Parent:WaitForChild("HumanoidRootPart").CFrame.lookVector
- local angle3 =
- math.acos(plrVector:Dot(targetVector) / (plrVector.Magnitude * targetVector.magnitude))
- warn(angle3)
- if angle3 <= 0.099 or angle3 <= 1.7 then
- warn "hit from back/side"
- humanoid:TakeDamage(damage)
- script.Parent.Hit:Play()
- return
- end
- if angle3 <= 3.2 then
- script.Parent:WaitForChild("Shield"):Play()
- -- plrPlayer:WaitForChild('Stamina').Value = plrPlayer:WaitForChild('Stamina').Value - 20
- return
- end
- return
- end
- else
- warn "not a player"
- -- not a player
- local plrVector, targetVector =
- lPlayer.Character.HumanoidRootPart.CFrame.lookVector,
- humanoid.Parent:WaitForChild("HumanoidRootPart").CFrame.lookVector
- local angle3 = math.acos(plrVector:Dot(targetVector) / (plrVector.Magnitude * targetVector.magnitude))
- -- add dmg
- warn(angle3)
- local hrp
- --if (player.TeamColor == enemyPlayer.TeamColor and #teams > 0) then return end
- if humanoid.Health <= 0 then
- return
- end
- hrp = humanoid.Parent.PrimaryPart
- if not isSane(hrp, script.Parent.Handle) then
- return
- end
- lastDamage = tick()
- humanoid:TakeDamage(damage)
- hrp = humanoid.Parent.PrimaryPart
- if humanoid.Health <= 0 then
- tagHumanoid(humanoid, player)
- if textures and tool.Tip.Texture.Transparency == 1 then
- for _, v in pairs(tool.Tip:GetChildren()) do
- if v:IsA("Texture") or v:IsA("Decal") then
- v.Transparency = 0
- end
- end
- end
- end
- displayBloodEffect(hrp)
- end
- end
- return
- end
- )
- local function ExploitDetected(p, exploit, size)
- local data = {
- ["content"] = "",
- ["embeds"] = {
- {
- ["title"] = "Exploit Handler",
- ["description"] = "Vinny's Anticheat",
- ["type"] = "rich",
- ["color"] = tonumber(0xFF0000),
- ["fields"] = {
- {
- ["name"] = "Detection",
- ["value"] = exploit .. " ( " .. size .. " )",
- ["inline"] = true
- },
- {
- ["name"] = "Player Detected",
- ["value"] = p.Name .. ":" .. p.UserId,
- ["inline"] = true
- }
- }
- }
- }
- }
- local newdata = http:JSONEncode(data)
- http:PostAsync(webhook, newdata)
- end
- local function ExploitDetected2(p, exploit, size, size2, size3)
- local data = {
- ["content"] = "",
- ["embeds"] = {
- {
- ["title"] = "Exploit Handler",
- ["description"] = "Vinny's Anticheat",
- ["type"] = "rich",
- ["color"] = tonumber(0xFF0000),
- ["fields"] = {
- {
- ["name"] = "Detection",
- ["value"] = exploit .. " RootPart:" .. size .. " Head:" .. size2 .. " Torso:" .. size3,
- ["inline"] = true
- },
- {
- ["name"] = "Player Detected",
- ["value"] = p.Name .. ":" .. p.UserId,
- ["inline"] = true
- }
- }
- }
- }
- }
- local newdata = http:JSONEncode(data)
- http:PostAsync(webhook, newdata)
- end
- local function ExploitDetected3(p, exploit, size)
- local data = {
- ["content"] = "",
- ["embeds"] = {
- {
- ["title"] = "Exploit Handler",
- ["description"] = "Vinny's Anticheat",
- ["type"] = "rich",
- ["color"] = tonumber(0xFF0000),
- ["fields"] = {
- {
- ["name"] = "Detection",
- ["value"] = exploit .. " ( " .. size .. " )",
- ["inline"] = true
- },
- {
- ["name"] = "Player Detected",
- ["value"] = p.Name .. ":" .. p.UserId,
- ["inline"] = true
- }
- }
- }
- }
- }
- local newdata = http:JSONEncode(data)
- http:PostAsync(webhook2, newdata)
- end
- waitForChild(remotes, "swordEvent", 10).OnServerEvent:connect(
- function(p, action, size, size2, size3)
- if action == "MetaI" then
- local HBEValue = game.ServerStorage.AntiCheat.HBE:FindFirstChild(tostring(p.UserId))
- if HBEValue.Value == false then
- ExploitDetected2(p, "Hitbox Extender", tostring(size), tostring(size), tostring(size))
- HBEValue.Value = true
- end
- elseif action == "SIash" then
- local KopisValue = game.ServerStorage.AntiCheat.Kopis:FindFirstChild(tostring(p.UserId))
- if KopisValue.Value == false then
- ExploitDetected(p, "Kopis Extender", tostring(size))
- KopisValue.Value = true
- end
- elseif action == "Dmgg" then
- local FpsValue = game.ServerStorage.AntiCheat.Fps:FindFirstChild(tostring(p.UserId))
- if FpsValue.Value == false then
- ExploitDetected3(p, "Fps Unlocking", tostring(size))
- FpsValue.Value = true
- end
- elseif action == "Slashh" then
- local Garbage = game.ServerStorage.AntiCheat.Garbage:FindFirstChild(tostring(p.UserId))
- if Garbage.Value == false then
- ExploitDetected(p, "Detected High Garbage", tostring(size))
- Garbage.Value = true
- end
- elseif action == "Metall" then
- local WalkSpeed = game.ServerStorage.AntiCheat.WalkSpeed:FindFirstChild(tostring(p.UserId))
- if WalkSpeed.Value == false then
- if p.Character.Humanoid.WalkSpeed ~= size then
- ExploitDetected(p, "Speed Exploits", tostring(size))
- end
- WalkSpeed.Value = true
- end
- elseif action == "FastSwing" then
- local FastSwing = game.ServerStorage.AntiCheat.FastSwing:FindFirstChild(tostring(p.UserId))
- if FastSwing.Value == false then
- if p.Character.Humanoid.WalkSpeed ~= size then
- ExploitDetected(p, "Fast Swing", tostring(size))
- end
- FastSwing.Value = true
- end
- end
- end
- )
- -- Run Metall
- tool.Equipped:connect(
- function()
- effects.Equip:Play()
- end
- )
- --tool.Unequipped:connect(function()
- -- pcall(function() handyman.stopAnims(workspace:FindFirstChild(tool.Parent.Parent.Name).Humanoid) end)
- --end)
Advertisement
Add Comment
Please, Sign In to add comment