I'm making a stun system in my game, and I have run into a problem with starting a function in a local script from a module script.
The first part probably isn't all that important, its just a remote event sending into the module script. The problem is on the module script. code :
function Attacking.Kick(HumanoidRootPart)
print("got the startup function")
-- script.Parent.PunchDamage.Punch()
if(HumanoidRootPart == nil) then
return
end
local overlapParams = OverlapParams.new()
local hitContents = workspace:GetPartBoundsInBox(HumanoidRootPart.CFrame*CFrame.new(0, 0, -5),Vector3.new(5, 6, 4), overlapParams)
local hitList = {}
for i,v in pairs(hitContents) do
local e_character = v.Parent
local c_humanoid = e_character:FindFirstChild("Humanoid")
if(c_humanoid) then
if not hitList[e_character] then
hitList[e_character] = true
local PunchSound = script.Parent.punch5
wait(0.15)
PunchSound:Play()
c_humanoid:TakeDamage(50)
--heres the problem
c_humanoid.FightManager.SentStun(1.5)
end
end
end
end
The main reason why I do this is because of a variable of the stun I need to set to prevent the player from using any move sets.
