How do I make a Fully Functional sprint (no stamina)

Also if it matters in your game, you should make checks where needed if they are allowed to sprint or not. As the above script example stands, exploiters can send “run” regardless if they are pressing shift or not, effictively giving them infinite “run” time.

2 Likes

Thank you, and I saw most of alvins videos I plan on finishing his scripting tutorial tomorrow

1 Like

Hello peanut brain is back, I hate to annoy you but…

game.ReplicatedStorage.Run.OnServerEvent:Connect(function(plr, inptype)
   if not workspace:FindFirstChild(plr.Name) then return end
   if inptype == "run" then
		      workspace[plr.Name].Humanoid.WalkSpeed = 35
		local character = workspace[plr.Name]
local animation = Instance.new("Animation")
local animationid = type animation id here
animation.AnimationId = "rbxassstid://5356324783"..animationid
character.Humanoid:LoadAnimation(animation)
   end
   if inptype == "walk" then
      workspace[plr.Name].Humanoid.WalkSpeed = 16
   end
end)

I want to know want i’m doing wrong. I will learn from mistakes

1 Like

At the local animationid = blah blah, change the text inside to get your animationid by publishing the animation

Expected identifier when parsing expression got (my animation id here)

at .animationid you should remove the id from the object but add it in the animationid variable

local animationid = type 5356324783
animation.AnimationId = "rbxassstid://5356324783"..5356324783
character.Humanoid:LoadAnimation(animation)

Change it to

local animationid = 5356324783
animation.AnimationId = "rbxassstid://"..animationid
character.Humanoid:LoadAnimation(animation)

[20:35:50.802 - Invalid animation id ‘<error: unknown AssetId protocol>’: ]

Change it to

animation.AnimationId = "rbxassstid://5356324783"
character.Humanoid:LoadAnimation(animation)

and remove the animationid variable, i think we should talk in DMs since this is spamming the post/topic.

the issue is a typo in “rbxassstid://” needs to be:“rbxassetid://” note the ‘asset’ being misspelled.

2 Likes

Everything is sorta fine the animation just won’t play, no errors

1 Like

thats because when you load the animation id into the humanoid, put a variable in front of it, then call :Play()

@Dev_Ryan, check out his answer it was a typo as he said, sorry for that lol.

Well the animation plays…and doesn’t stop.

I want it to stop if the key is no longer being pressed(which I’ve done before).

And can only start if they’re moving(and stops when they stop moving).

1 Like

@Steven_Rafft do you have some simple lines to detect movement

humanoid.Running:Connect(function(speed)

end)

I see things like this but they never work, if I could detect movement I feel I could do the rest myself.

1 Like

Nop. never tried using it before maybe u can check some topics?

Ok, in that case would you happen to know what type of script and where to put if if I made one to detect movement. I feel like that is what messes me up

1 Like

You can try using humanoid.running as you mentioned and you’ll add in the animation playing part.

That makes this 2 days I’ve been trying to get this to work, I won’t give up I’ll just take a break until I find something

1 Like