I want to make a tackle script so when a player hits another player that player goes to the ground. This is for a football game I have in the works.
I cant find solutions on YouTube or anywhere else including DevForum.
I made a hitbox script so that the player has an invisible box around their character,
when another player touches the box I don’t know how to make the player who got hit fall to the ground.
This is what my tackle script looks like so far, I have to believe that there is some CFrame operation to use to get the character on the ground in which I’m unsure of.
local Players = game:GetService("Players")
local tackledPlayer = script.Parent.Parent.Name --The hitbox's parent which is a character
script.Parent.hitbox.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local tacklerPlayer = game.Players:GetPlayerFromCharacter(hit.Parent)
if tacklerPlayer.Name ~= tackledPlayer.Name then
hit.Parent:FindFirstChild("HumanoidRootPart").CFrame = hit.Parent:FindFirstChild("HumanoidRootPart").CFrame * CFrame.new(0,0,0)
end
end
end)
Any suggestions or ideas are appreciated, Thank you.