Player.Character["Right Leg"].Touched:connect(function(hit)
if Kick == false then return end
if hit.Parent:FindFirstChild("Humanoid") then
Kick = false
end
if hit.Name ~= "TPS" then return end
local force = Player.Character["Right Leg"].CFrame.lookVector * 35
local angle = Vector3.new(90000000000,100000,90000000000)
Kick = false
TM.ApplyForce(hit, angle, force, "Right Leg")
end)
Player.Character["Right Leg"].Touched:connect(function(hit)
if Kick == false then return end
if hit.Parent:FindFirstChild("Humanoid") then
local Player = game.Players.LocalPlayer
local InputService = game:GetService("UserInputService")
InputService.InputBegan:Connect(function(Input, Processed)
if workspace.Configuration.Diving.Value == false then return end
if not Processed then
Player.Character:WaitForChild("Humanoid").PlatformStand = true
Player.Character.Torso.RotVelocity = Vector3.new()
Player.Character:WaitForChild("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
wait(1)
Player.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
Player.Character.Humanoid.PlatformStand = false
Player.Character.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
end
end)
Kick = false
Player.PlayerGui.FoulGui.TextLabel.Visible = true
wait (2)
Player.PlayerGui.FoulGui.TextLabel.Visible = false
if hit.Name ~= "TPS" then return end
Player.Character:WaitForChild("Humanoid").PlatformStand = true
Player.Character.Torso.RotVelocity = Vector3.new()
Player.Character:WaitForChild("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
wait(1)
Player.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
Player.Character.Humanoid.PlatformStand = false
Player.Character.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
local force = Player.Character["Left Leg"].CFrame.lookVector * 35
local angle = Vector3.new(90000000000,100000,90000000000)
Kick = false
TM.ApplyForce(hit, angle, force, "Left Leg")
wait (5)
Kick = true
end)
It doesn’t work. I have lines of code under this that are not underlined red.
Player.Character["Right Leg"].Touched:connect(function(hit)
if Kick == false then return end
if hit.Parent:FindFirstChild("Humanoid") then
local Player = game.Players.LocalPlayer
local InputService = game:GetService("UserInputService")
InputService.InputBegan:Connect(function(Input, Processed)
if workspace.Configuration.Diving.Value == false then return end
if not Processed then
Player.Character:WaitForChild("Humanoid").PlatformStand = true
Player.Character.Torso.RotVelocity = Vector3.new()
Player.Character:WaitForChild("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
wait(1)
Player.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
Player.Character.Humanoid.PlatformStand = false
Player.Character.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
end
end)
Kick = false
Player.PlayerGui.FoulGui.TextLabel.Visible = true
wait (2)
Player.PlayerGui.FoulGui.TextLabel.Visible = false
if hit.Name ~= "TPS" then return end
Player.Character:WaitForChild("Humanoid").PlatformStand = true
Player.Character.Torso.RotVelocity = Vector3.new()
Player.Character:WaitForChild("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
wait(1)
Player.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
Player.Character.Humanoid.PlatformStand = false
Player.Character.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
local force = Player.Character["Left Leg"].CFrame.lookVector * 35
local angle = Vector3.new(90000000000,100000,90000000000)
Kick = false
TM.ApplyForce(hit, angle, force, "Left Leg")
wait (5)
Kick = true
end)
function CloseEnoughToABall()
--[[
unfortunately you dont use
collectionservice to track the balls or anything in general, so i have to use
more inefficient method.
--]]
local Character = Player.Character
if not Character then return end
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
if not HumanoidRootPart then return end
local CharacterPosition = HumanoidRootPart.Position
-- DFC stands for distance from character
local ClosestBall
local ClosestBallDFC
local Children = workspace:GetChildren()
for _, Child in pairs(Children) do
if Child.Name == "TPS" then
local DescendantPosition = Child.Position
if ClosestBall and ClosestBallDFC then
local DistanceFromCharacter = (CharacterPosition - DescendantPosition).Magnitude
if DistanceFromCharacter < ClosestBallDFC then
ClosestBall = Child
ClosestBallDFC = DistanceFromCharacter
end
else
local DistanceFromCharacter = (CharacterPosition - DescendantPosition).Magnitude
ClosestBall = Child
ClosestBallDFC = DistanceFromCharacter
end
end
end
if ClosestBallDFC then
if ClosestBallDFC < Range then
return true
else
return false
end
else
return false
end
end
function ChangeOwner(ball)
game.ReplicatedStorage.ChangeOwner:FireServer(ball)
end
if hit.Parent:FindFirstChild("Humanoid") then
local Player = game.Players.LocalPlayer
local InputService = game:GetService("UserInputService")
InputService.InputBegan:Connect(function(Input, Processed)
if workspace.Configuration.Diving.Value == false then return end
if not Processed then return end
Player.Character:WaitForChild("Humanoid").PlatformStand = true
Player.Character.Torso.RotVelocity = Vector3.new()
Player.Character:WaitForChild("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
wait(1)
Player.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
Player.Character.Humanoid.PlatformStand = false
Player.Character.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end)
end