Its supposed to be moving one stud every 0.5 seconds but it only moves once when you press e. here's my script.
UserInputService = game:GetService("UserInputService")
local Part = game.Workspace.ColorPartTest
local x = Part.Position.X
local y = Part.Position.Y
local z = Part.Position.Z
local akeypressed = false
UserInputService.InputBegan:Connect(function(input,gameProccessedEvent)
if input.KeyCode == Enum.KeyCode.E then
akeypressed = true
while akeypressed == true do
wait(0.5)
Part.Position = Vector3.new(x + 1,y,z)
end
end
end)
UserInputService.InputEnded:Connect(function(input,gameProccessedEvent)
if input.KeyCode == Enum.KeyCode.E then
akeypressed = false
end
end)

1 comment
thanks dude