Hi devs, I’m back at it again with another hitbox issue. This time instead of taking down the other player. It only takes down the player with the ball. This makes no sense cause its not giving me an error. Please help me.
Code:
-- Get Needs
local Players = game:GetService('Players')
local Character = Players.LocalPlayer.Character
local Player = Players:GetPlayerFromCharacter(Character)
local Replicated = game:GetService('ReplicatedStorage')
local Ragdoll = Replicated.Rems.General:WaitForChild('Ragdoll')
local HitType = Replicated.Rems.General:WaitForChild('Hit-Type')
--
-- Random
local CanTackle = true
--
-- Needed
Character:WaitForChild('Hitbox').Touched:Connect(function(Hit)
local Type = math.random(1,2)
local OppHit = Hit.Parent
local OppPlayer = Players:GetPlayerFromCharacter(OppHit)
if OppPlayer then
if OppPlayer.Team ~= Player.Team and Character:FindFirstChild('Football') then
--
if CanTackle == true then CanTackle = false
if Type == 1 then
HitType:FireServer('Tackle')
Character.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
OppHit.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
Ragdoll:FireServer(Character,'Ragdoll')
Ragdoll:FireServer(OppHit,'Ragdoll')
wait(2)
Character.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
OppHit.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
Ragdoll:FireServer(Character,'UnRagdoll')
Ragdoll:FireServer(OppHit,'UnRagdoll')
wait(3)
CanTackle = true
end
if Type == 2 then
HitType:FireServer('Broken-Tackle')
Character.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
Ragdoll:FireServer(Character,'Ragdoll')
wait(0.7)
wait(3)
Character.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
Ragdoll:FireServer(Character,'UnRagdoll')
CanTackle = true
--
end
end
end
end
end)
If you need me to show the ragdoll script let me know