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!
Freezing the animation while you hold the key
and stop it after you release it -
What is the issue? Include screenshots / videos if possible!
It doesn’t freeze (pause) for some reason,and i don’t know why -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Just slamming my keyboard and praying that it will work (did not work)
I’m bad at explaining stuff so i cannot find it on devforum
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!
I’m pretty much new to this forum (and scripting) so i have no idea what is the part of the lua block thing and what is not so there might be some errors
This (local) script is placed into StarterCharacterScripts
local InputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local char = script.Parent
local GreenLoop = script:WaitForChild("Loop")
local GreenHeckLoop = char:WaitForChild("Humanoid"):LoadAnimation(GreenLoop)
local Greenheck = script:WaitForChild("Greenheck")
local GreenheckStop = script:WaitForChild("GreenheckStop")
InputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.F then
print("Key pressed")
local GreenHell = char:WaitForChild("Humanoid"):LoadAnimation(Greenheck) -- Animation Play
GreenHell:Play()
task.wait(2.5)
GreenHell:AdjustSpeed(0) -- Should pause the animation but doesn't for
-- some reason
end
end)
InputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.F then
print("Key released")
local Greenhell = char:WaitForChild("Humanoid"):LoadAnimation(Greenheck)
local GreenHellStop = char:WaitForChild("Humanoid"):LoadAnimation(GreenheckStop) -- Stops when the key is released
if GreenHeckLoop.IsPlaying then
GreenHeckLoop:Stop()
end
end
end)
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.