I’m creating an arena-style arcade fighting game and I’m trying to figure out how exactly I would create a dash that would stun the first enemy hit? I’m not looking for an actual code block obviously but what strategy would you use for this?
I’ve considered spawning a part that stuns players but I doubt that would be very efficient, is there a way I can make the entire player’s body stun or something? I am honestly stumped and considering just changing the ability entirely. Any ideas are appreciated
If any visual examples are useful think of Gragas’s bodyslam ability from League of Legends
Maybe, you could set a Touched Event inside the Character’s HumanoidRootPart when activated, detect if it will hit anything that’s a Target (Or other player), then the Target will take damage & you’ll stop dashing?
Possibly something like this could do, I’ll just give a broad example:
local Hitbox = script.Parent:WaitForChild("HumanoidRootPart") --You could put this in the Character model
local DashDamage = 50
local TargetDetected = false
Hitbox.Touched:Connect(function(Hit)
local Target = game.Players:GetPlayerFromCharacter(Hit.Parent)
if Target and TargetDetected == false then
TargetDetected = true
local TargetChar = Hit.Parent
TargetChar.Humanoid:TakeDamage(Damage)
TargetChar.Humanoid.PlatformStand = false
end
end
end)