Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I make a script when you press "F" the speed of the player increases to 100?

local Input = game:GetService("UserInputService") UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.F then game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) character.Humanoid.WalkSpeed = 130

end)

2 comments

0

use the characteradded as a variable

0

also capitalize the C in Character

1 answer

You need to put the PlayerAdded and CharacterAdded functions before

local Input = game:GetService("UserInputService")

game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) 	
Input.InputBegan:Connect(function(input) 
	if input.KeyCode == Enum.KeyCode.F then
				character.Humanoid.WalkSpeed = 130	
			end
		end)
	end)
end)

Tell me if that works. Also If it helped don't forget to mark as answered :)

This discussion is preserved as it was. New answers, comments, and votes are closed.