It stuns both the character and hitcharacter… i just wanna know if im missing something because it seems like you guys always spot it and i dont lol
local RunService = game:GetService("RunService")
local PlayerService = game:GetService("Players")
local Https = game:GetService("HttpService")
local Manager = require(game:GetService("ServerScriptService").Combat.Main.Manager)
local StunService = {}
local Stunners = {}
function StunService.Stun(HitCharacter, Character, StunTime)
if not Stunners[HitCharacter] then
Stunners[HitCharacter] = {}
end
print(HitCharacter)
local HitData = Manager:Retrieve(HitCharacter)
if HitData.Status.StunResistant then return end;
table.insert(Stunners[HitCharacter], Character)
print(Stunners)
local Current_Time = os.clock()
if #Stunners[HitCharacter] <= 1 then
HitData.Status.IsStunned = true
HitData.CharacterInfo.LastStun = Current_Time
end
if StunTime ~= nil then
task.delay(StunTime, function()
if HitData.CharacterInfo.LastStun == Current_Time then
task.spawn(function()
if #Stunners[HitCharacter] > 1 then
HitData.Status.StunResistant = true
task.wait(0.6)
HitData.Status.StunResistant = false
end
end)
HitData.Status.IsStunned = false
Stunners[HitCharacter] = {}
warn("Auto unstunned " .. tostring(HitCharacter) .. " And cleared stunner list")
end
end)
end
end
return StunService