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 want to make the dance GUI look really good and learn more about scripting.
What is the issue? Include screenshots / videos if possible! I want to make a dance speed button gui where you speed up the dance or slow it down like this
What solutions have you tried so far? Did you look for solutions on the Developer Hub? I try a lot of stuff but none of them work and I looked on developer hub but there is nothing like what Im trying to looking for.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that itās easier for people to help you!
-- This is an example Lua code block
Please do not ask people to write entire scripts or design entire systems for you. If you canāt answer the three questions above, you should probably pick a different category.
local normalSpeedTime = animationTrack.Length / animationTrack.Speed
animationTrack:AdjustSpeed(3)
local fastSpeedTime = animationTrack.Length / animationTrack.Speed
print(āAt normal speed the animation will play forā, normalSpeedTime, āsecondsā)
print(āAt 3x speed the animation will play forā, fastSpeedTime, āsecondsā)
Sorry for the late response but youād connect a event to detect if the button has been clicked, get all the playing tracks, loop through the tracks and call the function (im on mobile so there might be mistakes):
local Players = game:GetService('Players')
local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild('Humanoid')
local animator = humanoid:WaitForChild('Animator')
script.Parent.Activated:Connect(function()
local tracks = animator:GetPlayingAnimationTracks()
for _, track in pairs(tracks) do
track:AdjustSpeed(2)
end
end)
i change a bit of the script but like when im walking it change the speed too i want it only change the dance speed.
local Players = game:GetService(āPlayersā)
local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local dancing = false
local humanoid = char:WaitForChild(āHumanoidā)
local animator = humanoid:WaitForChild(āAnimatorā)
script.Parent.Activated:Connect(function()
local tracks = animator:GetPlayingAnimationTracks()
while dancing do
wait()
for _, track in pairs(tracks) do
track:AdjustSpeed(5)
end
end
end)