#Running Script Help!
22 messages · Page 1 of 1 (latest)
How do I do that thing you did there?
put 3 of ` at the top and bottom of the script
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
-- Supposedly checks for the player when they get added
local function onCharacterAdded(Character)
local humanoid = Character:WaitForChild("Humanoid")
end
-- Supposedly checks for the player when they connect or join
player.CharacterAdded:Connect(onCharacterAdded)
-- This Gets Reference for the Players Humanoid
local humanoid = character:WaitForChild("Humanoid")
-- This gets the reference for Left Shift
local userInputService = game:GetService("UserInputService")
local leftShiftButton = Enum.KeyCode.LeftShift
-- This Checks when the Left Shift Button is Pressed
userInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == leftShiftButton then
humanoid.WalkSpeed = 32
end
end)
-- This Checks when the Left Shife Button is Released
userInputService.InputEnded:Connect(function(input, gameProcessed)
if input.KeyCode == leftShiftButton then
humanoid.WalkSpeed = 16
end
end)```
Because the humanoid change when you die
I dont know how to fix. Im kinda still new
type
```lua
[Insert Code]
```
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
-- Supposedly checks for the player when they get added
local function onCharacterAdded(Character)
humanoid = Character:WaitForChild("Humanoid")
end
-- Supposedly checks for the player when they connect or join
player.CharacterAdded:Connect(onCharacterAdded)
-- This Gets Reference for the Players Humanoid
local humanoid = character:WaitForChild("Humanoid")
-- This gets the reference for Left Shift
local userInputService = game:GetService("UserInputService")
local leftShiftButton = Enum.KeyCode.LeftShift
-- This Checks when the Left Shift Button is Pressed
userInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == leftShiftButton then
humanoid.WalkSpeed = 32
end
end)
-- This Checks when the Left Shife Button is Released
userInputService.InputEnded:Connect(function(input, gameProcessed)
if input.KeyCode == leftShiftButton then
humanoid.WalkSpeed = 16
end
end)```
@sleek ore
Works ?
When I die I cannot sprint still
Try removing this local