Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- findTarget = function()
- local distance = 10000
- local target
- for i,v in pairs(workspace:WaitForChild("dungeon"):GetDescendants()) do
- local humanoid = v:FindFirstChildOfClass("Humanoid")
- local head = v:FindFirstChild("Head")
- if humanoid and head then
- if localplayer.Character:FindFirstChild("HumanoidRootPart") then
- if (head.Position - localplayer.Character.HumanoidRootPart.Position).magnitude < distance then
- distance = (head.Position - localplayer.Character.HumanoidRootPart.Position).magnitude
- target = head
- end
- end
- end
- end
- return target
- end,
- getBossOffset = function(boss)
- if boss then
- if bosses[boss] then
- return bosses[boss].offset
- else
- error("boss not found")
- end
- end
- end,
- Swing = function()
- for i,v in pairs(localplayer.Backpack:GetChildren()) do
- if v:IsA("Tool") then
- if v:FindFirstChild("abilitySlot") then
- v:FindFirstChildOfClass("RemoteEvent"):FireServer()
- end
- end
- end
- for i,v in pairs(localplayer.Character:GetChildren()) do
- if v:IsA("Accessory") then
- if v:FindFirstChild("swing") then
- v:FindFirstChildOfClass("RemoteEvent"):FireServer()
- end
- end
- end
- end,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement