This content originally appeared on DEV Community and was authored by Matthew Ramirez
¡Hola! Esta es mi primera publicación y hoy aprendí a crear un script de Super velocidad. El personaje podrá aumentar su velocidad al mantener presionada la tecla Shift.
¿Dónde debemos colocar nuestro Script?
Debe ubicarse cerca del personaje, dentro de StarterPlayer -> StarterCharacterScripts. De esta forma, nuestro script tendrá contexto sobre los hijos de Character, como el Humanoid.
Usaremos UserInputService para manejar las entradas del usuario y actualizar la WalkSpeed del Humanoid.
local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local defaultWaklSpeed = humanoid.WalkSpeed
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(
function(input, processed)
if not processed and input.KeyCode == Enum.KeyCode.LeftShift then
print("Se esta presionando shift")
humanoid.WalkSpeed = defaultWaklSpeed * 2
end
end
)
UserInputService.InputEnded:Connect(
function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
print("Se dejo de presionar shift")
humanoid.WalkSpeed = defaultWaklSpeed
end
end
)
Gracias por leer, diviértanse!
This content originally appeared on DEV Community and was authored by Matthew Ramirez
Matthew Ramirez | Sciencx (2025-10-26T21:47:55+00:00) Scripts: Super speed [ES]. Retrieved from https://www.scien.cx/2025/10/26/scripts-super-speed-es/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.
