#UserInputService
1 messages · Page 1 of 1 (latest)
Script:
local inputservice = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local isSprinting = false
local function shiftclicked(input, _gameProcessed)
if input.UserInputType == Enum.KeyCode.LeftShift then
isSprinting = true
print("Player has clicked shift and now sprinting is true.")
elseif isSprinting == true then
if input.UserInputType == Enum.KeyCode.LeftShift then
isSprinting = false
print("Player has clicked shift and now sprinting is false.")
end
end
end
inputservice.InputBegan:Connect(shiftclicked)
Someone please help
local UserInputService = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local isSprinting = false
local function onInputBegan(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.LeftShift then
isSprinting = not isSprinting
print("Sprinting is now:", isSprinting)
end
end
UserInputService.InputBegan:Connect(onInputBegan)
i think this one works
ill try, thanks
It works! Thank you so much