When I run my scripts, it gives me an error saying that the animation ID cannot be found, when I inserted the ID of the animation that I created
I placed the basketball as a tool
Here are the scripts:
--Script
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local M6D = Instance.new("Motor6D", char.RightHand) -- or the part that you have decieded
M6D.Name = "ToolGrip"
char.ChildAdded:Connect(function(child)
if child:IsA("Tool") and child:FindFirstChild("BodyAttach") then
M6D.Part1 = child.BodyAttach
end
end)
end)
end)
--LocalScript
local anim = Instance.new("Animation", script.Parent)
anim.AnimationId = "12963424741" -- id here
local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local load = char:WaitForChild("Humanoid"):LoadAnimation(anim)
script.Parent.Equipped:Connect(function()
while true do
wait(0.49)
anim:Play()
end
end)
script.Parent.Unequipped:Connect(function()
anim:Stop()
end)
When I run my scripts, it gives me an error saying that the animation ID cannot be found, when I inserted the ID of the animation that I created
I placed the basketball as a tool
Here are the scripts:
--Script
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local M6D = Instance.new("Motor6D", char.RightHand) -- or the part that you have decieded
M6D.Name = "ToolGrip"
char.ChildAdded:Connect(function(child)
if child:IsA("Tool") and child:FindFirstChild("BodyAttach") then
M6D.Part1 = child.BodyAttach
end
end)
end)
end)
--LocalScript
local anim = Instance.new("Animation", script.Parent)
anim.AnimationId = "rbxassetid://12963424741" -- id here
local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local load = char:WaitForChild("Humanoid"):LoadAnimation(anim)
script.Parent.Equipped:Connect(function()
while true do
wait(0.49)
anim:Play()
end
end)
script.Parent.Unequipped:Connect(function()
anim:Stop()
end)
Thanks, the error is gone.
However it gives me a new error:
Play is not a valid member of Animation “Workspace.DMLGDPCC.Tool.Animation” - Client - LocalScript:11
I can’t seem to figure out how to fix that either…
--LocalScript
local anim = Instance.new("Animation", script.Parent)
anim.AnimationId = "rbxassetid://12963424741" -- id here
local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local load = char:WaitForChild("Humanoid"):LoadAnimation(anim)
script.Parent.Equipped:Connect(function()
while true do
wait(0.49)
load:Play()
end
end)
script.Parent.Unequipped:Connect(function()
load:Stop()
end)