Hello all!
I’m trying to make a ‘step’ counter for the player and I have found using AnimationTrack’s GetMarkerReachedSignal works the best for this purpose. But I can’t reach animationtrack.
Server Script:
script.LocalScript:Clone().Parent = game.StarterPlayer.StarterCharacterScripts --not relevant to issue
local Players = game:GetService("Players")
local Billboard = game:GetService("ServerStorage"):WaitForChild("BillboardPart")--not relevant to issue
Players.PlayerAdded:Connect(function(Player)
local animationtrack = nil
local character = Player.Character or Player.CharacterAdded:Wait()
local humanoid = character:FindFirstChild("Humanoid")
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://507777826"
local animator = humanoid:FindFirstChildOfClass("Animator")
if animator then
animationtrack = animator:LoadAnimation(Animation)
end
--From here down is not relevant to the issue
local leaderstats = Instance.new("Folder", Player)
local StepsValue = Instance.new("NumberValue", leaderstats)
local NewBillboard = Billboard:Clone()
NewBillboard.BillboardGui.PlayerName.Text = Player.Name.." has"
NewBillboard.Parent = workspace
NewBillboard.Name = Player.Name .. "'s Billboard"
game:GetService("RunService").Stepped:Connect(function()
NewBillboard.BillboardGui.steps.Text = StepsValue.Value
end)
end)
Output:
Thnaks for the help!
Tomroblox54321