of     1   

Pyracel
#186876863Wednesday, April 06, 2016 10:02 PM GMT

the animTrack is a loopable crouch animation. When you press c it plays the animation until c is pressed again or so I thought. I dont know how to fix this! Do you have any idea how I could make this work. repeat wait() until game.Players.LocalPlayer.Character ~= nil local animation = game.Players.LocalPlayer.Character:WaitForChild("Crouch") local animTrack = script.Parent.Parent.Character.Humanoid:LoadAnimation(animation) local Mouse = game.Players.LocalPlayer:GetMouse() local Crouching = false Mouse.KeyDown:connect(function(key) if key == "c" and Crouching == false then Crouching = true repeat wait(1)animTrack:Play() until Crouching == false end end) Mouse.KeyDown:connect(function(key) if key == "c" and Crouching == true then Crouching = false animTrack:Stop() end end)
Pyracel
#186877194Wednesday, April 06, 2016 10:07 PM GMT

Bump
KeiRoMultiverse
#186877656Wednesday, April 06, 2016 10:14 PM GMT

I think the problem is that you overwrote the function. Just keep everything in one function. Mouse.KeyDown:connect(function(key) if key == "c" and Crouching == false then Crouching = true repeat wait(1)animTrack:Play() until Crouching == false elseif if key == "c" and Crouching == true then Crouching = false animTrack:Stop() end end)
Pyracel
#186878089Wednesday, April 06, 2016 10:20 PM GMT

But then it would run the first part, change "Crouching" to true, there fore running the second function.
KeiRoMultiverse
#186878339Wednesday, April 06, 2016 10:24 PM GMT

No, it'll completely ignore the second function even if crouching is changed to true. Just try it out.
Pyracel
#186878863Wednesday, April 06, 2016 10:31 PM GMT

I said that because I have had experience with it doing what I just told you. It didnt work, just as I had suspected.
KeiRoMultiverse
#186879305Wednesday, April 06, 2016 10:37 PM GMT

Oh, I found a problem that might be it, I put an if directly after elsif. Try this: Mouse.KeyDown:connect(function(key) if key == "c" and Crouching == false then Crouching = true repeat wait(1)animTrack:Play() until Crouching == false elseif key == "c" and Crouching == true then Crouching = false animTrack:Stop() end end)
llaserx
#186880183Wednesday, April 06, 2016 10:51 PM GMT

No one suggested userinputservice U all horrible http://wiki.roblox.com/index.php?title=API:Class/UserInputService
script_frog
#186880257Wednesday, April 06, 2016 10:52 PM GMT

uis or go away
Casualist
#186880994Wednesday, April 06, 2016 11:02 PM GMT

local player = game:GetService("Players").LocalPlayer local character = player.Character or player.CharacterAdded:wait() local animation = character:WaitForChild("Crouch") local animTrack = character:WaitForChild("Humanoid"):LoadAnimation(animation) local Mouse = player:GetMouse() local Crouching = false Mouse.KeyDown:connect(function(key) if not key:lower() == "c" then return end Crouching = not Crouching if Crouching then while Crouching do wait(1) animTrack:Play() end else animTrack:Stop() end end)
Pyracel
#186896657Thursday, April 07, 2016 2:31 AM GMT

Ya ehatever, user input service. The methoad I used works and its simple. Deal With It
Exovis
#186899265Thursday, April 07, 2016 3:19 AM GMT

keydown works fine fire is outdated heaters exist why don't you use a heater while camping or something does not compute
Pyracel
#186900584Thursday, April 07, 2016 3:45 AM GMT

Cuz camping is meant to be old fashioned.
Exovis
#186901475Thursday, April 07, 2016 4:03 AM GMT

and scripting is meant to be scripting doesn't matter how you do it if it works and you enjoy using a certain method does not compute
sharpchain1
#186908273Thursday, April 07, 2016 8:17 AM GMT

Use CFrame then you dont have to worry about seamlessly looping animations using the animation editor ~sharpchain1 Leader of Domini Studios
Pyracel
#188512448Tuesday, May 03, 2016 10:53 AM GMT

Hmmm... I guess I could do that... But how?
Infocus
#188513052Tuesday, May 03, 2016 11:29 AM GMT

repeat wait() until game.Players.LocalPlayer.Character ~= nil local animation = game.Players.LocalPlayer.Character:WaitForChild("Crouch") local animTrack = script.Parent.Parent.Character.Humanoid:LoadAnimation(animation) local Mouse = game.Players.LocalPlayer:GetMouse() local Crouching = false Mouse.KeyDown:connect(function(key) if key == "c" and Crouching == true then Crouching = false animTrack:Stop() elseif key == "c" and Crouching == false then Crouching = true repeat wait(1)animTrack:Play() until Crouching == false end end) -- And for the cframe anims: https://forum.roblox.com/Forum/ShowPost.aspx?PostID=158629446
Pyracel
#188535510Tuesday, May 03, 2016 9:59 PM GMT

thanks!

    of     1