I still don’t understand how this even exist…
I’m working on some animation stuff for a game I’m working on and I’ve been having issues trying to load and play a simple animation I created. I cannot figure out how to fix this, as Roblox Studio throws this error (which is the title of this post) at me for when I use the item.
I’m losing my mind over it and I still l can’t seem to find any sort of post that solves this issue, so please if anyone knows how animations work in Roblox Studio, help!
For anyone wondering, I’ve tried swapping from a Script to a LocalScript, changed where some variables go, and I’ve checked the AnimationIds.
Here’s the script so anyone can help…
local Tool = script.Parent;
local enabled = true
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local DrinkCola = Instance.new("Animation")
DrinkCola.AnimationId = "rbxassetid://129257978377171"
local DeathAnim = Instance.new("Animation")
DeathAnim.AnimationId = "rbxassetid://108731674990495"
local function onActivated()
local DrinkTrack = Humanoid:LoadAnimaton(DrinkCola)
local DeathTrack = Humanoid:LoadAnimation(DeathAnim)
DrinkTrack.Looped = false
DeathTrack.Looped = false
if not enabled then
return
end
enabled = false
Character:WaitForChild("HumanoidRootPart").Anchored = true
DrinkTrack:Play()
Tool.Handle.DrinkSound:Play()
task.wait(6)
Tool.Handle.Scream:Play()
DeathTrack:Play()
task.wait(0.5)
Humanoid.Health = 0
Tool.Handle.Scream:Stop()
task.wait(0.03)
Character:Destroy()
-- Safe guard for when player's character doesn't load in after reset
task.wait(3)
Player:LoadCharacter()
enabled = true
end
local function onEquipped()
Tool.Handle.OpenSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
Yes, some parts are from a Bloxy Cola script, but I’m improvising it a little bit.