local plr = game.Players.LocalPlayer
repeat wait() until workspace:WaitForChild(plr.Name)
local PlrGui = plr:WaitForChild("PlayerGui")
local PcGui = PlrGui:WaitForChild("PowerGuiPC")
local PCFrame = PcGui:WaitForChild("Frame")
local PowerTextPC = PCFrame:WaitForChild("Power")
local MGui = PlrGui:WaitForChild("PowerGuiMobile")
local MobileControls = PlrGui:WaitForChild("Controls")
local MobileFrame = MGui:WaitForChild("Frame")
local PowerTextMobile = MobileFrame:WaitForChild("Power")
local char = plr.Character
local hum = char:WaitForChild("Humanoid")
local HandleAnim = char:WaitForChild("Handle")
local DribbleAnim = char:WaitForChild("Dribble")
local HandleTrack = hum:LoadAnimation(HandleAnim)
local DribbleTrack = hum:LoadAnimation(DribbleAnim)
local UIS = game:GetService("UserInputService")
local CAS = game:GetService("ContextActionService")
local RepStorage = game:GetService("ReplicatedStorage")
local Events = RepStorage:WaitForChild("Events")
local Equip = Events:WaitForChild("EquipBall")
local PCPlayer = UIS.KeyboardEnabled == true
local MobilePlayer = UIS.TouchEnabled == true
-- Delays
local DribbleDelay = 0.1
local DebounceDelay = 0.2
local BehindDelay = 0.5
--
local http = "http://www.roblox.com/asset/?id="
local Disabled = false
local function Dribble(String, Ball)
local ScriptsFolder = Ball:WaitForChild("Scripts")
local AnimationTable = require(ScriptsFolder:WaitForChild("AnimationTable"))
for i, v in pairs(AnimationTable.Animations) do
if i == String then
DribbleTrack:Stop()
DribbleTrack:Destroy()
DribbleAnim.AnimationId = http .. v
DribbleTrack = hum:LoadAnimation(DribbleAnim)
DribbleTrack:Play()
end
end
end
local function Handle(String, Ball)
local ScriptsFolder = Ball:WaitForChild("Scripts")
local AnimationTable = require(ScriptsFolder:WaitForChild("AnimationTable"))
for i, v in pairs(AnimationTable.Animations) do
DribbleTrack:Stop()
DribbleTrack:Destroy()
HandleTrack:Stop()
HandleTrack:Destroy()
HandleAnim.AnimationId = http .. v
HandleTrack = hum:LoadAnimation(HandleAnim)
HandleTrack:Play()
end
end
-- Load Animation
char.ChildAdded:Connect(function(Child)
if Child.Name == "Ball" then
local Ball = Child
local Events = Ball:WaitForChild("Events")
local ChangeHand = Events:WaitForChild("ChangeHand")
local Values = Ball:WaitForChild("Values")
local Hand = Values:WaitForChild("Hand")
local ScriptsFolder = Ball:WaitForChild("Scripts")
local AnimationTable = require(ScriptsFolder:WaitForChild("AnimationTable"))
for _, v in pairs(AnimationTable.Animations) do
HandleAnim.AnimationId = http .. v
hum:LoadAnimation(HandleAnim)
end
end
end)
char.ChildRemoved:Connect(function(Child)
if Child.Name == "Ball" then
HandleTrack:Stop()
DribbleTrack:Stop()
end
end)
Equip.OnClientEvent:Connect(function(Ball, PowerValue, HandValue)
if PCPlayer then
PcGui.Enabled = true
PowerTextPC.Text = PowerValue
elseif MobilePlayer then
MobileControls.Enabled = true
MGui.Enabled = true
PowerTextMobile.Text = PowerValue
end
-- Update GUI
if Disabled == false then
if char:FindFirstChild("Ball") then
if HandValue == 0 then
Dribble("RightDribble", Ball)
else
Dribble("LeftDribble", Ball)
end
end
end
-- IDK
end)
UIS.InputBegan:Connect(function(input, gameProcessed)
if char:FindFirstChild("Ball") then
local Ball = char:FindFirstChild("Ball")
local Events = Ball:WaitForChild("Events")
local ChangeHand = Events:WaitForChild("ChangeHand")
local Values = Ball:WaitForChild("Values")
local Hand = Values:WaitForChild("Hand")
if input.KeyCode == Enum.KeyCode.H or input.KeyCode == Enum.KeyCode.L then
if Disabled == false then
Disabled = true
if Hand.Value == 0 then
ChangeHand:FireServer(1)
Dribble("LeftDribble", Ball)
wait(DribbleDelay)
elseif Hand.Value == 1 then
ChangeHand:FireServer(0)
Dribble("RightDribble", Ball)
wait(DribbleDelay)
end
wait(DebounceDelay)
Disabled = false
end
elseif input.KeyCode == Enum.KeyCode.F then
if Disabled == false then
Disabled = true
ChangeHand:FireServer(0)
Handle("FakeCross", Ball) -- the animation shpuld play here but it did not play
print(Handle("FakeCross")) -- the line of errors
wait(BehindDelay)
if char:FindFirstChild("Ball") then
Dribble("RightDribble", Ball)
end
wait(DebounceDelay)
Disabled = false
end
end
end
end)
This is erroring because, at this point, Ball does not exist. According to the if statment, if the ball does not exist, do the dribble stuff, if it does do then FakeCross. Your if statment are wrong.
Here is what’s correct:
local plr = game.Players.LocalPlayer
local character ) plr.Character
local PlrGui = plr:WaitForChild("PlayerGui")
local PcGui = PlrGui:WaitForChild("PowerGuiPC")
local PCFrame = PcGui:WaitForChild("Frame")
local PowerTextPC = PCFrame:WaitForChild("Power")
local MGui = PlrGui:WaitForChild("PowerGuiMobile")
local MobileControls = PlrGui:WaitForChild("Controls")
local MobileFrame = MGui:WaitForChild("Frame")
local PowerTextMobile = MobileFrame:WaitForChild("Power")
local char = plr.Character
local hum = char:WaitForChild("Humanoid")
local HandleAnim = char:WaitForChild("Handle")
local DribbleAnim = char:WaitForChild("Dribble")
local HandleTrack = hum:LoadAnimation(HandleAnim)
local DribbleTrack = hum:LoadAnimation(DribbleAnim)
local UIS = game:GetService("UserInputService")
local CAS = game:GetService("ContextActionService")
local RepStorage = game:GetService("ReplicatedStorage")
local Events = RepStorage:WaitForChild("Events")
local Equip = Events:WaitForChild("EquipBall")
local PCPlayer = UIS.KeyboardEnabled == true
local MobilePlayer = UIS.TouchEnabled == true
-- Delays
local DribbleDelay = 0.1
local DebounceDelay = 0.2
local BehindDelay = 0.5
--
local http = "http://www.roblox.com/asset/?id="
local Disabled = false
local function Dribble(String, Ball)
local ScriptsFolder = Ball:WaitForChild("Scripts")
local AnimationTable = require(ScriptsFolder:WaitForChild("AnimationTable"))
for i, v in pairs(AnimationTable.Animations) do
if i == String then
DribbleTrack:Stop()
DribbleTrack:Destroy()
DribbleAnim.AnimationId = http .. v
DribbleTrack = hum:LoadAnimation(DribbleAnim)
DribbleTrack:Play()
end
end
end
local function Handle(String, Ball)
local ScriptsFolder = Ball:WaitForChild("Scripts")
local AnimationTable = require(ScriptsFolder:WaitForChild("AnimationTable"))
for i, v in pairs(AnimationTable.Animations) do
DribbleTrack:Stop()
DribbleTrack:Destroy()
HandleTrack:Stop()
HandleTrack:Destroy()
HandleAnim.AnimationId = http .. v
HandleTrack = hum:LoadAnimation(HandleAnim)
HandleTrack:Play()
end
end
-- Load Animation
char.ChildAdded:Connect(function(Child)
if Child.Name == "Ball" then
local Ball = Child
local Events = Ball:WaitForChild("Events")
local ChangeHand = Events:WaitForChild("ChangeHand")
local Values = Ball:WaitForChild("Values")
local Hand = Values:WaitForChild("Hand")
local ScriptsFolder = Ball:WaitForChild("Scripts")
local AnimationTable = require(ScriptsFolder:WaitForChild("AnimationTable"))
for _, v in pairs(AnimationTable.Animations) do
HandleAnim.AnimationId = http .. v
hum:LoadAnimation(HandleAnim)
end
end
end)
char.ChildRemoved:Connect(function(Child)
if Child.Name == "Ball" then
HandleTrack:Stop()
DribbleTrack:Stop()
end
end)
Equip.OnClientEvent:Connect(function(Ball, PowerValue, HandValue)
if PCPlayer then
PcGui.Enabled = true
PowerTextPC.Text = PowerValue
elseif MobilePlayer then
MobileControls.Enabled = true
MGui.Enabled = true
PowerTextMobile.Text = PowerValue
end
-- Update GUI
if Disabled == false then
if char:FindFirstChild("Ball") then
if HandValue == 0 then
Dribble("RightDribble", Ball)
else
Dribble("LeftDribble", Ball)
end
end
end
-- IDK
end)
UIS.InputBegan:Connect(function(input, gameProcessed)
if char:FindFirstChild("Ball") then
local Ball = char:FindFirstChild("Ball")
local Events = Ball:WaitForChild("Events")
local ChangeHand = Events:WaitForChild("ChangeHand")
local Values = Ball:WaitForChild("Values")
local Hand = Values:WaitForChild("Hand")
if input.KeyCode == Enum.KeyCode.H or input.KeyCode == Enum.KeyCode.L then
if Disabled == false then
Disabled = true
if Hand.Value == 0 then
ChangeHand:FireServer(1)
Dribble("LeftDribble", Ball)
wait(DribbleDelay)
elseif Hand.Value == 1 then
ChangeHand:FireServer(0)
Dribble("RightDribble", Ball)
wait(DribbleDelay)
end
wait(DebounceDelay)
Disabled = false
elseif input.KeyCode == Enum.KeyCode.F then
if Disabled == false then
Disabled = true
ChangeHand:FireServer(0)
Handle("FakeCross", Ball) -- the animation shpuld play here but it did not play
print(Handle("FakeCross")) -- the line of errors
wait(BehindDelay)
if char:FindFirstChild("Ball") then
Dribble("RightDribble", Ball)
end
wait(DebounceDelay)
Disabled = false
end
end
end
end)
It seems that this script was just ripped out of the above video, please don’t do that, make your own scripts.