Thank you for your response, but heres what comes out of the output
15:00:56.389 - Players.fonmin123.Backpack.Cup.drinkscript:10: attempt to index nil with ‘Character’
Sorry for the mistake, your error has occurred since I’ve declared LocalPlayer
variable before the tool got parented to player.
This should work:
local Cup = script.Parent
local Animation = Cup.Animation
local isDrinking = false
Cup.Activated:Connect(function()
if isDrinking then return end
local LocalPlayer = game:GetService("Players").LocalPlayer
isDrinking = true
local Character = Cup.Parent
local Humanoid = LocalPlayer.Character.Humanoid
local AnimationTrack = Humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
AnimationTrack.Stopped:Wait()
isDrinking = false
end)
Thank you for all of the help you have offered me. Really appreciated by me.
And also for some reason it keeps telling me attempt to index nil with character. Idk why.
Nvm, I had to put it in a local script, no errors in the output, but the animation won’t play?
Did you enable RequiresHandle
and added part named 'Handle'
as a child of your cup tool?
Tool.Activated
only fires when you have those two above done.
Or, does the place owner owns the animation? Unless the place owner owns the animation, it won’t play.
Yes, I did checkmark Requires Hand, and there is a part called Handle.
I just did test on my studio, and it seems to be working fine.
Could you confirm this as well?
It is a group game, but I am not the owner of the group is that why it will not work?
When submitting the animation do I tell my friend to put creator: me, or creator: (group name) does it matter?
The animation must be uploaded to the group.
If the game is group game, I suggest you to put creator as group.
Well, the animation doesn’t play, but atleast there are no errors in the output so idk, again…
Okay, here’s your checklist:
- Put script in
LocalScript
- Make sure script is parented directly to
Tool
- Make sure
RequiresHandle
is enabled - Make sure
Handle
is parented directly toTool
- Make sure
Animation
is uploaded as creatorGroup
- Set
AnimationId
with id of animation which is uploaded as creatorGroup
- If animation is made for R6, make sure game to have default avatar to R6.
And it would be helpful if you attach link of the uploaded animation.
Is the game uploaded to the group? Or is it uploaded to the account of the group’s owner
The game is uploaded to the group.
Would you mind taking this to PM? So I could give you direct help.
Alright, sure we can take this to pm