You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I want to make a tackle script so when a player touches/hits another player that player goes to the ground.
- What is the issue? Include screenshots / videos if possible!
I cant find solutions on YouTube or anywhere else including DevForum.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
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 touched/hit go 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.