Dssall2
(Dssall2)
June 5, 2023, 2:06pm
1
So I have a script for breaking a tree:
local animation = script:WaitForChild("Animation")
local prompt = script.Parent.ProximityPrompt
local Basic = script.Parent.Parent
local treeFallSound = game:GetService("SoundService").TreeFall
local TweenService = game:GetService("TweenService")
prompt.Triggered:Connect(function(player)
local Character = player.Character or player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local animationLoad = Humanoid:LoadAnimation(animation)
animationLoad:Play()
Humanoid.WalkSpeed = 0
Humanoid.JumpHeight = 0
Character.HumanoidRootPart.Position = script.Parent.Parent.TpToTreee.Position
prompt.Enabled = false
wait(5) -- break time
Basic.Parent = game:GetService("ReplicatedStorage")
prompt.Enabled = true
script.Parent.Parent.Cylinder.Transparency = 0
animationLoad:Stop()
treeFallSound:Play()
Humanoid.WalkSpeed = 13
Humanoid.JumpHeight = 7.2
player.Data.TreeCount.Value += player.Data.TreeCountGet.Value
local getText = player.PlayerGui.GetItems.treeGetText
local textGetClone = getText:Clone()
textGetClone.Parent = player.PlayerGui.GetItems
textGetClone.Visible = true
textGetClone.Name = "textGetClone"
local targetPosition = UDim2.new(0.882, 0, 0.532, 0)
local tweenInfo = TweenInfo.new(0.6)
local tween = TweenService:Create(textGetClone, tweenInfo, {Position = targetPosition})
tween:Play()
local getImage = player.PlayerGui.GetItems.treeGet
local getImageClone = getImage:Clone()
getImageClone.Parent = player.PlayerGui.GetItems
getImageClone.Visible = true
getImageClone.Name = "GetImageClone"
local targetPosition = UDim2.new(0.913, 0, 0.5, 0)
local tweenInfo = TweenInfo.new(0.6)
local tween = TweenService:Create(getImageClone, tweenInfo, {Position = targetPosition})
tween:Play()
wait(1.5)
getImageClone:Destroy()
textGetClone:Destroy()
wait(90) -- respawn time
Basic.Parent = workspace.Map["Luffy's Village"].Decorations
end)
And here’s a test animation I made in Moon Animator:
What’s the problem, is that when I execute the script. Everything works, except that the animation does not have this very stick:
This is where the animation lies:
And here I have a question, as I understand I need to add somewhere this very stick so it was in the animation, right?
But exactly how to do it I do not know, what should I do?
Dssall2
(Dssall2)
June 5, 2023, 3:18pm
3
local animation = script:WaitForChild("Animation")
local prompt = script.Parent.ProximityPrompt
local Basic = script.Parent.Parent
local treeFallSound = game:GetService("SoundService").TreeFall
local TweenService = game:GetService("TweenService")
prompt.Triggered:Connect(function(player)
local Character = player.Character or player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
--local animationLoad = Humanoid:LoadAnimation(animation)
local Animator = Humanoid:FindFirstChildOfClass("Animator")
Animator:LoadAnimation(animation)
Animator:Play()
Humanoid.WalkSpeed = 0
Humanoid.JumpHeight = 0
Character.HumanoidRootPart.Position = script.Parent.Parent.TpToTreee.Position
prompt.Enabled = false
wait(5) -- break time
Basic.Parent = game:GetService("ReplicatedStorage")
prompt.Enabled = true
script.Parent.Parent.Cylinder.Transparency = 0
Animator:Stop()
treeFallSound:Play()
Humanoid.WalkSpeed = 13
Humanoid.JumpHeight = 7.2
player.Data.TreeCount.Value += player.Data.TreeCountGet.Value
local getText = player.PlayerGui.GetItems.treeGetText
local textGetClone = getText:Clone()
textGetClone.Parent = player.PlayerGui.GetItems
textGetClone.Visible = true
textGetClone.Name = "textGetClone"
local targetPosition = UDim2.new(0.882, 0, 0.532, 0)
local tweenInfo = TweenInfo.new(0.6)
local tween = TweenService:Create(textGetClone, tweenInfo, {Position = targetPosition})
tween:Play()
local getImage = player.PlayerGui.GetItems.treeGet
local getImageClone = getImage:Clone()
getImageClone.Parent = player.PlayerGui.GetItems
getImageClone.Visible = true
getImageClone.Name = "GetImageClone"
local targetPosition = UDim2.new(0.913, 0, 0.5, 0)
local tweenInfo = TweenInfo.new(0.6)
local tween = TweenService:Create(getImageClone, tweenInfo, {Position = targetPosition})
tween:Play()
wait(1.5)
getImageClone:Destroy()
textGetClone:Destroy()
wait(90) -- respawn time
Basic.Parent = workspace.Map["Luffy's Village"].Decorations
end)
That’s it, if so, it gives this error:
Dssall2
(Dssall2)
June 5, 2023, 3:32pm
7
Look, I’ll explain in detail, I have only animation, and as I understand there is no stick in the animation as it is nowhere and is not stored, and just here I have to you and the question, where do I have to create a stick and where to throw this Handler, I tell you right away that I would not want the stick was as a tool as I use it only for animation.
system
(system)
Closed
June 19, 2023, 3:44pm
9
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.