Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local KnitPackage = ReplicatedStorage.Packages._Index:FindFirstChild("[email protected]")
- if not KnitPackage then
- warn("Knitパッケージが見つかりませんでした。")
- return
- end
- local AttackService = KnitPackage.knit.Services.AttackOtherService
- if not AttackService or not AttackService.RF or not AttackService.RF.Attack then
- warn("AttackOtherServiceが見つかりませんでした。")
- return
- end
- local AttackFunction = AttackService.RF.Attack
- local scriptEnabled = true
- local delay = 0.1
- local function performAttack(targetCharacter)
- if not scriptEnabled or not targetCharacter or not targetCharacter:FindFirstChild("HumanoidRootPart") then
- return
- end
- local args = {
- [1] = targetCharacter.HumanoidRootPart,
- [2] = {
- ["Performance"] = {
- ["Vfx"] = {
- ["StartTimeSec"] = 0,
- ["Name"] = "GizagizaHit2",
- ["DurationSec"] = 0.5
- },
- ["SoundDuration"] = 1.5,
- ["SoundId"] = 9117969687
- },
- ["Range"] = {
- ["Offset"] = {
- ["HasNoOffset"] = function()end,
- ["Position"] = Vector3.new(0, 0, 0),
- ["ComputeRotationMatrix"] = function()end,
- ["ComputeProcessedTransform"] = function()end,
- ["Rotation"] = Vector3.new(0, 0, 0),
- ["ComputeMatrix"] = function()end
- },
- ["Radius"] = 7,
- ["Height"] = 0,
- ["AngleHalf"] = 135
- },
- ["Parameter"] = {
- ["PlayerPoint"] = 1,
- ["Magnitude"] = 120,
- ["StateName"] = "reaction_blown_up",
- ["StopDurationSec"] = 0.4,
- ["RecoveryDurationSec"] = 0.5
- }
- },
- [3] = targetCharacter.HumanoidRootPart.Position
- }
- pcall(function()
- AttackFunction:InvokeServer(unpack(args))
- end)
- end
- local function getOtherPlayersCharacters()
- local localPlayer = Players.LocalPlayer
- if not localPlayer then return {} end
- local otherPlayersCharacters = {}
- for _, player in Players:GetPlayers() do
- if player ~= localPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
- table.insert(otherPlayersCharacters, player.Character)
- end
- end
- return otherPlayersCharacters
- end
- local function attackPlayers()
- local playerList = {}
- local currentIndex = 1
- while scriptEnabled do
- playerList = getOtherPlayersCharacters()
- if #playerList > 0 then
- local targetCharacter = playerList[currentIndex]
- if targetCharacter and targetCharacter:FindFirstChild("HumanoidRootPart") then
- performAttack(targetCharacter)
- currentIndex = (currentIndex % #playerList) + 1
- else
- if currentIndex > #playerList then
- currentIndex = 1
- end
- end
- else
- currentIndex = 1
- end
- wait(delay)
- end
- end
- local localPlayer = Players.LocalPlayer
- if localPlayer then
- local function onLocalPlayerDied(character)
- if character == localPlayer.Character then
- scriptEnabled = false
- end
- end
- localPlayer.CharacterAdded:Connect(function(character)
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- if humanoid then
- humanoid.Died:Connect(function()
- onLocalPlayerDied(character)
- end)
- end
- end)
- if localPlayer.Character then
- local humanoid = localPlayer.Character:FindFirstChildOfClass("Humanoid")
- if humanoid then
- humanoid.Died:Connect(function()
- onLocalPlayerDied(localPlayer.Character)
- end)
- end
- end
- attackPlayers()
- else
- warn("LocalPlayerが見つかりませんでした。")
- end
Add Comment
Please, Sign In to add comment