I have a wave ingame that when its hitbox is touched it ragdolls the player, but I want it to also push the player in the direction the wave is moving, I have no clue how to do that
Visual example:
(PD: I know in the video the model isn’t welded correctly but that’s not the issue i already fixed that)
local hitbox = wave.HitPart.Touched:Connect(function(hit)
local char = hit.Parent
if char:FindFirstChild("Humanoid") == nil then return end
local plr = game:GetService("Players"):GetPlayerFromCharacter(char)
if hitlist[char] == true then return end
hitlist[char] = true
-- Touch end
local touchend = wave.HitPart.TouchEnded:Connect(function()
print("done")
end)
-- Tsunami behaviour
RagdollController.RagdollCharacter(char)
task.wait(1)
hitlist[char] = false
touchend:Disconnect()
end)
local hitbox = wave.HitPart.Touched:Connect(function(hit)
local char = hit.Parent
if char:FindFirstChild("Humanoid") == nil then return end
local plr = game:GetService("Players"):GetPlayerFromCharacter(char)
if hitlist[char] == true then return end
hitlist[char] = true
-- Touch end
local touchend = wave.HitPart.TouchEnded:Connect(function()
print("done")
end)
-- Tsunami behaviour
RagdollController.RagdollCharacter(char)
char.HumanoidRootPart:ApplyImpulse(wave.HitPart.CFrame.LookVector * char.HumanoidRootPart.AssemblyMass)
task.wait(1)
hitlist[char] = false
touchend:Disconnect()
end)