Here’s what i wanted to make
https://gyazo.com/e2947b566d7655fa9a6d7d5d37eac0bd
I already know about looping a hitbox or a raycast but to make something like this i have so tween fast to achieve this effect BUT it went so fast that ray cast and hitbox can’t hit the target what i wanna ask from this forum is how to tween something like humanoidrootpart or whatever they use in the video i sent and make it so that even tough it go fast but the ray and hitbox still hit (because i loop the raycast and hitbox with runservice it still dosen;t so i assumed that the tween go to fast)
And here’s the code
H.Parent = HumRoot
–HumRoot.Anchored = true
local Tween = TS:Create(HumRoot,TweenInfo.new(0.4,Enum.EasingStyle.Linear,Enum.EasingDirection.Out),{CFrame = HumRoot.CFrame + HumRoot.CFrame.LookVector * 53})
Tween:Play()
local O
local hiy
O = game:GetService("RunService").Heartbeat:Connect(function()
local filterTable = {Character}
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Blacklist
params.FilterDescendantsInstances = filterTable
params.IgnoreWater = true
local ray = workspace:Raycast(Character.HumanoidRootPart.Position,Character.HumanoidRootPart.CFrame.LookVector * 1,params)
local params1 = RaycastParams.new()
params1.FilterType = Enum.RaycastFilterType.Blacklist
params1.FilterDescendantsInstances = filterTable
params1.IgnoreWater = true
local ray1 = workspace:Raycast(Character.HumanoidRootPart.Position,Character.HumanoidRootPart.CFrame.UpVector * -3 ,params1)
if ray or ray1 then
O:Disconnect()
Tween:Pause()
game.Debris:AddItem(H,0.01)
end
end)
hiy = game:GetService("RunService").Heartbeat:Connect(function()
local Hitbox = Instance.new("Part")
Hitbox.Size = Vector3.new(5.126, 3.186, 8.442)
Hitbox.CFrame = HumRoot.CFrame + HumRoot.CFrame.LookVector * 0.8
local op = OverlapParams.new()
op.FilterDescendantsInstances = {Character}
op.FilterType = Enum.RaycastFilterType.Blacklist
local parts = workspace:GetPartsInPart(Hitbox,op)
local debounce = false
for _,hit in pairs(parts) do
if hit.Parent and hit.Parent ~= Character and not FindStunInCharacter and hit.Parent:FindFirstChildWhichIsA("Humanoid") and debounce == false then
local hum = hit.Parent:FindFirstChildWhichIsA("Humanoid")
local FF1 = hit.Parent:FindFirstChild("BlockHits")
local Immune = hit.Parent:FindFirstChild("Immune")
local Model = hit.Parent:IsA("Model")
------------------------------------------------------------------------------
local Bovy = Instance.new("BodyVelocity")
Bovy.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
Bovy.Velocity = Character:FindFirstChild("HumanoidRootPart").CFrame.LookVector * 32
local B = Instance.new("BodyVelocity")
B.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
B.Velocity = Character:FindFirstChild("HumanoidRootPart").CFrame.LookVector * 3.5
local B1 = Instance.new("BodyVelocity")
B1.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
B1.Velocity = Character:FindFirstChild("HumanoidRootPart").CFrame.UpVector * 15
-------------------------------------------------------------------------------
local function Effecthit()
HitEffect.Parent = hit.Parent.HumanoidRootPart
game.Debris:AddItem(HitEffect,0.96)
for i,b in pairs(HitEffect:GetChildren()) do
if b.Name == "Ring" and b:IsA("ParticleEmitter") then
b:Emit(1)
end
if b.Name == "OtherLines" and b:IsA("ParticleEmitter") then
b:Emit(2)
end
if b.Name == "EffectRing" and b:IsA("ParticleEmitter") then
b:Emit(1)
end
if b.Name == "Lines" and b:IsA("ParticleEmitter") then
b:Emit(4)
end
if b.Name == "HitEffect" and b:IsA("ParticleEmitter") then
b:Emit(1)
end
if b.Name == "Shadow" and b:IsA("ParticleEmitter") then
b:Emit(1)
end
end
local animationsFolder = RS.Animations.AnimFolder:GetChildren()
local randomAnimation = animationsFolder[math.random(1, #animationsFolder)]
hum:LoadAnimation(randomAnimation):Play();
end
local function FindSomethingToDeleteBeforeHit()
for i,v in pairs(hit.Parent.HumanoidRootPart:GetChildren()) do
if v:IsA("BodyVelocity") or v:IsA("BodyGyro") then
game.Debris:AddItem(v,0)
end
end
end
local function HitPAS()
local J = game:GetService("RunService")
local K
K = J.Heartbeat:Connect(function()
HumRoot.Anchored = true
hit.Parent.HumanoidRootPart.Anchored = true
hit.Parent.HumanoidRootPart.CFrame = CFrame.new((Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-4)).p,Character.HumanoidRootPart.CFrame.p)
end)
wait(0.27)
K:Disconnect()
wait()
HumRoot.Anchored = false
hit.Parent.HumanoidRootPart.Anchored = false
end
local HittedAnEnemy = Character:FindFirstChild("HittedAnEnemy")
if hum and not FF1 and hum.Health > 0 and not Immune and Model then
hiy:Disconnect()
O:Disconnect()
debounce = true
Tween:Pause()
game.Debris:AddItem(H,0.01)
HitPAS()
StunValueModule.Stun(hit.Parent,1.2)
StunWalkSpeedModule.Stun(hum,1.2)
Character.Combo.Value = Character.Combo.Value + 1
hum:TakeDamage(15)
Damage:FireAllClients("DamageHit",hit.Parent.HumanoidRootPart,15,Color3.new(0.027451, 0.0196078, 0.0627451))
local B21 = Instance.new("BodyVelocity")
B21.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
B21.Velocity = Character:FindFirstChild("HumanoidRootPart").CFrame.LookVector * 15 + Character:FindFirstChild("HumanoidRootPart").CFrame.UpVector * 5
B21.Parent = hit.Parent.HumanoidRootPart
game.Debris:AddItem(B21,0.34)
end
end
end
end)
wait(0.4)
game.Debris:AddItem(H,0.01)
Tween:Pause()
O:Disconnect()
hiy:Disconnect()
end)
Hope you guys can figure this out for me, i’m having a lot issue with this.