hello, i’m making a tackle script, but theres a bug that i don’t see in the script, only half script works.
can someone please help me? Thanks! PS is a script in StarterCharacterScripts
local UserInputService = game:GetService("UserInputService")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local Animator = humanoid:WaitForChild("Animator")
local Ball = game.Workspace.Boru
local deb = true
local debstu = true
local h = false
local function helo()
character.RightFoot.Touched:Connect(function(hit)
if hit.Parent:WaitForChild('Humanoid', math.huge) then
if debstu == true then
debstu = false
local hitchar = hit.Parent
hitchar:WaitForChild('Tackle').Disabled = true
hitchar:WaitForChild('TackleClient').Disabled = true
if hitchar.Name == Ball.Owner.Value then
Ball:WaitForChild('WeldConstraint'):Destroy()
Ball.Velocity = Vector3.new(1 * 1 * 40)
hitchar.Pass.Disabled = true
hitchar.Kick.Disabled = true
hitchar.WeldBall.Disabled = true
script.Parent.Kick.Disabled = false
h = true
Ball.Owner.Value = character.Name
local Weld = Instance.new("WeldConstraint")
Weld.Parent = Ball
Ball.CastShadow = false
Weld.Part0 = Ball
Weld.Part1 = character.HumanoidRootPart
Ball.Orientation = Vector3.new(0,0,0)
Ball.Position = character:FindFirstChild('WeldPart').Position
-- From this part it don't Work :/
local hitHum = hitchar:FindFirstChild('Humanoid')
local Animator = hitHum:WaitForChild("Animator")
local TackleStunAnimation = Instance.new("Animation")
TackleStunAnimation.AnimationId = "rbxassetid://10500976679"
local TackleStunAnimationTrack = Animator:LoadAnimation(TackleStunAnimation)
TackleStunAnimationTrack:Play()
hitHum.WalkSpeed = 0
wait(3.3)
hitHum.WalkSpeed = 16
hitchar.WeldBall.Disabled = false
TackleStunAnimationTrack:Stop()
wait(5)
hitchar:WaitForChild('Tackle').Disabled = false
hitchar:WaitForChild('TackleClient').Disabled = false
debstu = true
end
end
end
end)
end
script.Parent.TackleEv.OnServerEvent:Connect(helo)