Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I have this animation script is it possible to make it even better?

Soo, I have a slide animation that runs if i press [c] but when pressed then i just stands still and runs the animation i want it to be like when i press [c] then i slide forwards

what can i add on this script so it will be like that any tips?

local Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()

Mouse.KeyDown:connect(function(Key)
	if(Key:lower() == "c") then -- What button to press
		anim = Player.Character.Humanoid:LoadAnimation(script.animTest) -- Loads the animation
		anim:Play() -- Plays the animation
	end
end)

1 comment

0

@tacktic2010 and how do i add player velocity to a player and bodypostion to a player when pressing [c]

1 answer

To achieve the idea that you want you will need to apply velocity to your character, this can be done using Body Velocity then setting the velocity to the player's look vector, more info about how to do this can be found on the roblox wiki also there may be a problem of where you seem to be floating, if this occurs then temporarily move the players position down slightly!

This discussion is preserved as it was. New answers, comments, and votes are closed.