Setting variable with W

you are the best, it works, now i need to do the same with s and then it is done, how can i thank you?

i repllied to the wrong person

well, this devforum is to help other people, so no need to thank me by words. And you just replied to urself

1 Like

i replied to my self, but the script wroks

Found The issue. I actually used this script. In the functions you used the parameter “key”. I looked up on the developer section. The Parameter you were meant to use was “input”. Now of course I just kept the 2 events so the code was turned into this.

local run = game:GetService("RunService")
local uis = game:GetService("UserInputService")
local interval = 1 -- Edit how fast it speeds up
local increment = 5 -- Edit how much speed gives



uis.InputBegan:Connect(function(input)


if input.KeyCode == Enum.KeyCode.W then
	print("W key held")
	
end
end)

uis.InputEnded:Connect(function(input)


if input.KeyCode == Enum.KeyCode.W then
	print("W key released")

end
end)

local timeSinceUpdate = tick()
run.Stepped:Connect(function()

end)

note: there are still traces of your anticheat
oof should have removed them

well all of my scripts use this, yet I have no errors.

uis.InputBegan:Connect(function(key, type)
	if type then return end
	
	if key.KeyCode == KeyCode then
		-- Code
	end
end)

I am not sure if it is because of the seat or something that made his script not work, but i have been using this script for a very long time without any errors