- What do you want to achieve? Keep it simple and clear!
Hey so I’m doing a script where to receive an offering the player bow’s down, he then proceeds to stand up.
This is done in 2 times, so 2 clicks.
1/ 1stClick, player Bow’s Down, and he receives offering, the first animation is put on pause and the player stays in this position.
2/ 2ndClick, player resumes 1st animation making it end, and stands up using another animation
- What is the issue? Include screenshots / videos if possible!
The offering is multiplied, it should give one. I’m guessing it’s because of the local script?
And when I unequip the tool that animates my character, after the first animation. The second animation won’t let the first one charge.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried to get some variables out of EQUIPPED function. Because if I equip and unequip, all the animations are reloaded, so getting them out of that function would probably solve the problem of the 1st animation still being paused, or being stuck.
But the script gives an error.
from what I understand the character wasn’t given enough time to load?
I had already made a thread about this, and putting the variables in EQUIPPED seemed to fix it.
Now I’m trying to fix the animation getting blocked.
local tool = script.Parent
local Players = game:GetService("Players")
local player= Players.LocalPlayer
local givetoolplace = game.ReplicatedStorage
local loopcount=0
local number=1
tool.Equipped:Connect(function()
script.Parent["Handle"].Name = "Block" -- this is so that there isin't the hold animation for the tool anymore
local Humanoid = player.Character:WaitForChild("Humanoid") -- it's saying that the character doesn't exist?
print("2")
local Animator= Humanoid:WaitForChild("Animator")
local AnimationB= Instance.new("Animation") -- first animation
local AnimationB2=Instance.new("Animation") -- second animation
AnimationB.AnimationId= "rbxassetid://12916317663"
AnimationB2.AnimationId="rbxassetid://12916616730"
AnimationBTrack = Animator:LoadAnimation(AnimationB)
AnimationB2Track = Animator:LoadAnimation(AnimationB2)
end)
tool.Unequipped:Connect(function()
script.Parent["Block"].Name= "Handle" -- put back the handle if not the whole script kinda falls apart x)
end)
tool.Activated:Connect(function()
number+=1 -- got this number so I can do first anim then 2nd on 2nd click
if number % 2 ==0 then -- check if it's pair or not
loopcount+=1
AnimationBTrack:Play()
print(number,":number pair? +",loopcount , ":loop number")
AnimationBTrack:GetMarkerReachedSignal("STOP"):Connect(function() -- goes more than once idk why, also STOP is the SINGLE event in the animationB
AnimationBTrack:AdjustSpeed(0) -- makes it blocked
print(loopcount,":loop number")
givetoolplace["ToolOrange"] :Clone().Parent=player.Backpack -- clone the tool I want to give to playre
end)
else AnimationBTrack:AdjustSpeed(1) -- here I let the first animation finsih
print(number,":number pair?")
AnimationB2Track:Play()-- 2d animation get up play
end
end)
https://drive.google.com/drive/folders/1-t63TUxBxnEcruixE_q8nc-xafv1jLc5
^^^
if you want to see the errors in action
I guess it’s time to go deep into the API let’s do this