Hello I once again have a problem in my game but this time it is partly the script and probably a priority in my roblox animation which i predict. So what is basically happening is when im using my crawl and slide script it will also use roblox running script. Is there a way to stop this? (im predicting i have to change the animation priority) Here is the video sorry if it looks like a nintendo ds recording i had to lower my obs settings and here is the script.
local id = "rbxassetid://6169678056" local anim = Instance.new("Animation") local animation local slidingid = "rbxassetid://6169761361" local slidinganim = Instance.new("Animation") local slidinganimation anim.AnimationId = id slidinganim.AnimationId = slidingid local cas = game:GetService("ContextActionService") local function crawl(actionname, inputstate, inputobject) if actionname == "Crawl" then if inputstate == Enum.UserInputState.Begin then local player = game.Players.LocalPlayer animation = player.Character.Humanoid:FindFirstChild("Animator"):LoadAnimation(anim) animation:Play() else animation:Stop() animation:Destroy() end end end local function sliding(actionname,inputstate,inputobject) if actionname == "Slide" then if inputstate == Enum.UserInputState.Begin then local player = game.Players.LocalPlayer slidinganimation = player.Character.Humanoid:FindFirstChild("Animator"):LoadAnimation(slidinganim) slidinganimation:Play() else slidinganimation:Stop() slidinganimation:Destroy() end end end cas:BindAction("Crawl",crawl,true,Enum.KeyCode.C,Enum.KeyCode.LeftControl,Enum.KeyCode.ButtonR1) cas:BindAction("Slide",sliding,true,Enum.KeyCode.LeftShift,Enum.KeyCode.S,Enum.KeyCode.ButtonL1)
This is a local script by the way.
then you need to write end in the end of your script, like this:
local id = "rbxassetid://6169678056" local anim = Instance.new("Animation") local animation local slidingid = "rbxassetid://6169761361" local slidinganim = Instance.new("Animation") local slidinganimation anim.AnimationId = id slidinganim.AnimationId = slidingid local cas = game:GetService("ContextActionService") local function crawl(actionname, inputstate, inputobject) if actionname == "Crawl" then if inputstate == Enum.UserInputState.Begin then local player = game.Players.LocalPlayer animation = player.Character.Humanoid:FindFirstChild("Animator"):LoadAnimation(anim) animation:Play() else animation:Stop() animation:Destroy() end end end local function sliding(actionname,inputstate,inputobject) if actionname == "Slide" then if inputstate == Enum.UserInputState.Begin then local player = game.Players.LocalPlayer slidinganimation = player.Character.Humanoid:FindFirstChild("Animator"):LoadAnimation(slidinganim) slidinganimation:Play() else slidinganimation:Stop() slidinganimation:Destroy() end end end cas:BindAction("Crawl",crawl,true,Enum.KeyCode.C,Enum.KeyCode.LeftControl,Enum.KeyCode.ButtonR1) cas:BindAction("Slide",sliding,true,Enum.KeyCode.LeftShift,Enum.KeyCode.S,Enum.KeyC end
or am I missing sonething?