You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I am attemping to make a tool work with an animation one of my group members made.
- What is the issue? Include screenshots / videos if possible!
I am using the animation correctly and it is playing but it only goes a certain distance and ends. Here is a video of the occurance
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I attempted to look online but no tutorials I can find are helpful by any means,
here is the code
local remoteEvents = game.ReplicatedStorage:WaitForChild("Remotes").Events
local Calculator = require(game.ServerScriptService:WaitForChild("Modules").Calculator)
local DataManager = require(game.ServerScriptService:WaitForChild("Modules").DataManager)
local ShieldInfo = require(game.ServerScriptService:WaitForChild("Modules").Info.ShieldInfo)
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
wait(5)
local weapon = DataManager:GetData("PlayerStore", "CurrentWeapon", player)
local clone = game.ReplicatedStorage:WaitForChild("Weapons")["Default Sword"]:Clone()
clone.Parent = player:WaitForChild("Backpack")
--local grip = char.RightHand:WaitForChild("RightGrip"):Destroy()
clone.Activated:Connect(function()
local Strength = Calculator:CalculateStrength(player)
local newStrength = DataManager:GetData("PlayerStore", "Strength", player) + Strength
local ShieldSize = ShieldInfo[DataManager:GetData("PlayerStore", "CurrentShield", player)].size
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://5245704492"
local SwingAnimTrack = player.Character.Humanoid:LoadAnimation(Animation)
SwingAnimTrack:Play()
wait(.01)
if newStrength > ShieldSize then
local difference = newStrength - ShieldSize
newStrength = newStrength - difference
end
DataManager:SetData("PlayerStore", "Strength", newStrength, player)
SwingAnimTrack.Stopped:Wait()
Animation:Destroy()
SwingAnimTrack:Destroy()
end)
end)
end)```