Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local WalkAnimation = {5, 1, 9, 13}; --Key.Value == 1.
- local function KeyDownMovement(Plr, directionToUpdate, Iteration)
- local Facing = plrInput:WaitForChild(Plr.Name).Actions.Facing; --Direction the character is facing.
- local plrFrame = proximityView:WaitForChild(Plr.Name); --Player's character frame position.
- local NewDirection = {
- plrFrame.Position - UDim2.new(0, 0, 0, 40);
- plrFrame.Position + UDim2.new(0, 0, 0, 40);
- plrFrame.Position - UDim2.new(0, 40, 0, 0);
- plrFrame.Position + UDim2.new(0, 40, 0, 0)
- }
- --Collision Check here.
- directionToUpdate.Value = 1; --Makes movement true.
- Facing.Value = Iteration; --Sets idle position for Key Up.
- while directionToUpdate.Value == 1 do
- plrFrame.Position = NewDirection[Iteration];
- wait(0.3); --Needs to be a var.
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement