local UserInputService = game:GetService("UserInputService")
local Hold = false
UserInputService.InputBegan:Connect(function(input, gameProssesed)
if gameProssesed then return end
if input.KeyCode == Enum.KeyCode.E then
while Hold == true do
wait(0.1)
print("TEST1")
end
end
end)
UserInputService.InputEnded:Connect(function(input, Prossesed)
if Prossesed then return end
if input.KeyCode == Enum.KeyCode.E then
while Hold == false do
print("TEST2")
end
end
end)
#UserInputService
1 messages · Page 1 of 1 (latest)
what did you need help
if i did press "E" the game get crash
because you're printing
try remove print
yes
k lemme know
ohh i fixed it
local UserInputService = game:GetService("UserInputService")
local Hold = false
UserInputService.InputBegan:Connect(function(input, gameProssesed)
if gameProssesed then return end
if input.KeyCode == Enum.KeyCode.E then
Hold = true
while Hold == true do
wait(0.1)
print("TEST1")
end
end
end)
UserInputService.InputEnded:Connect(function(input, Prossesed)
if Prossesed then return end
if input.KeyCode == Enum.KeyCode.E then
Hold = false
print("TEST2")
end
end)
before and before ahh
** You are now Level 2! **
k thanks
its too ez to fix