I’m planning that when the player presses a key, a displacement animation is activated and at the same time the position of the main part is changed:
local player = game.Players.LocalPlayer
local uis = game:GetService("UserInputService")
local char = player.Character
local animacion = script:WaitForChild("Animation")
local humanoid = char:WaitForChild("Humanoid")
local parteprincipal = char:FindFirstChild("HumanoidRootPart")
local dummy = game.Workspace.Dummy
local value = true
local activar = humanoid:LoadAnimation(animacion)
uis.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.E then
if value then
value = false
activar:Play()
wait(1)
parteprincipal.CFrame = parteprincipal.CFrame.LookVector + Vector3.new(0,0,10)
--dummy.HumanoidRootPart.CFrame.LookVector = CFrame.new(Vector3.new(0,0,3))
wait(5)
value = true
end
end
end)
but I get this in the output:
What I want most is that if you can change the script so that it works as I said at the beginning of I would thank you very much and a solution