tomoneko

sin

Apr 13th, 2025
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.19 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  3. local KnitPackage = ReplicatedStorage.Packages._Index:FindFirstChild("[email protected]")
  4. if not KnitPackage then
  5. warn("Knitパッケージが見つかりませんでした。")
  6. return
  7. end
  8. local AttackService = KnitPackage.knit.Services.AttackOtherService
  9. if not AttackService or not AttackService.RF or not AttackService.RF.Attack then
  10. warn("AttackOtherServiceが見つかりませんでした。")
  11. return
  12. end
  13. local AttackFunction = AttackService.RF.Attack
  14.  
  15. local scriptEnabled = true
  16. local delay = 0.1
  17.  
  18. local function performAttack(targetCharacter)
  19. if not scriptEnabled or not targetCharacter or not targetCharacter:FindFirstChild("HumanoidRootPart") then
  20. return
  21. end
  22.  
  23. local args = {
  24. [1] = targetCharacter.HumanoidRootPart,
  25. [2] = {
  26. ["Performance"] = {
  27. ["Vfx"] = {
  28. ["StartTimeSec"] = 0,
  29. ["Name"] = "GizagizaHit2",
  30. ["DurationSec"] = 0.5
  31. },
  32. ["SoundDuration"] = 1.5,
  33. ["SoundId"] = 9117969687
  34. },
  35. ["Range"] = {
  36. ["Offset"] = {
  37. ["HasNoOffset"] = function()end,
  38. ["Position"] = Vector3.new(0, 0, 0),
  39. ["ComputeRotationMatrix"] = function()end,
  40. ["ComputeProcessedTransform"] = function()end,
  41. ["Rotation"] = Vector3.new(0, 0, 0),
  42. ["ComputeMatrix"] = function()end
  43. },
  44. ["Radius"] = 7,
  45. ["Height"] = 0,
  46. ["AngleHalf"] = 135
  47. },
  48. ["Parameter"] = {
  49. ["PlayerPoint"] = 1,
  50. ["Magnitude"] = 120,
  51. ["StateName"] = "reaction_blown_up",
  52. ["StopDurationSec"] = 0.4,
  53. ["RecoveryDurationSec"] = 0.5
  54. }
  55. },
  56. [3] = targetCharacter.HumanoidRootPart.Position
  57. }
  58.  
  59. pcall(function()
  60. AttackFunction:InvokeServer(unpack(args))
  61. end)
  62. end
  63.  
  64. local function getOtherPlayersCharacters()
  65. local localPlayer = Players.LocalPlayer
  66. if not localPlayer then return {} end
  67.  
  68. local otherPlayersCharacters = {}
  69. for _, player in Players:GetPlayers() do
  70. if player ~= localPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
  71. table.insert(otherPlayersCharacters, player.Character)
  72. end
  73. end
  74. return otherPlayersCharacters
  75. end
  76.  
  77. local function attackPlayers()
  78. local playerList = {}
  79. local currentIndex = 1
  80.  
  81. while scriptEnabled do
  82. playerList = getOtherPlayersCharacters()
  83. if #playerList > 0 then
  84. local targetCharacter = playerList[currentIndex]
  85. if targetCharacter and targetCharacter:FindFirstChild("HumanoidRootPart") then
  86. performAttack(targetCharacter)
  87. currentIndex = (currentIndex % #playerList) + 1
  88. else
  89. if currentIndex > #playerList then
  90. currentIndex = 1
  91. end
  92. end
  93. else
  94. currentIndex = 1
  95. end
  96. wait(delay)
  97. end
  98. end
  99.  
  100. local localPlayer = Players.LocalPlayer
  101. if localPlayer then
  102. local function onLocalPlayerDied(character)
  103. if character == localPlayer.Character then
  104. scriptEnabled = false
  105. end
  106. end
  107.  
  108. localPlayer.CharacterAdded:Connect(function(character)
  109. local humanoid = character:FindFirstChildOfClass("Humanoid")
  110. if humanoid then
  111. humanoid.Died:Connect(function()
  112. onLocalPlayerDied(character)
  113. end)
  114. end
  115. end)
  116.  
  117. if localPlayer.Character then
  118. local humanoid = localPlayer.Character:FindFirstChildOfClass("Humanoid")
  119. if humanoid then
  120. humanoid.Died:Connect(function()
  121. onLocalPlayerDied(localPlayer.Character)
  122. end)
  123. end
  124. end
  125.  
  126. attackPlayers()
  127. else
  128. warn("LocalPlayerが見つかりませんでした。")
  129. end
Add Comment
Please, Sign In to add comment