Guest User

Untitled

a guest
Nov 2nd, 2019
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. local uis = game:GetService("UserInputService")
  2. local byteFlag = 0
  3. local xByte = 0
  4. local yByte = 0
  5. uis.InputBegan:Connect(function(key)
  6. if byteFlag == 1 then
  7. if script.Parent.Text then
  8. xByte = script.Parent.Text
  9. byteFlag = 2
  10. print(xByte)
  11. end
  12. end
  13.  
  14. if byteFlag == 2 then
  15. if key.KeyCode == Enum.KeyCode.Return then
  16. local yByte = script.Parent.Text
  17. byteFlag = 3
  18. print(yByte)
  19. end
  20. end
  21.  
  22. if byteFlag == 3 then
  23. script.Parent.Parent.Position.X = script.Parent.Parent.Position.X + xByte
  24. script.Parent.Parent.Position.Y = script.Parent.Parent.Position.Y + yByte
  25. byteFlag = 0
  26. end
  27.  
  28. if key.KeyCode == Enum.KeyCode.Return and byteFlag == 0 then
  29. --Blah blah blah code stuff
  30. if string.lower(script.Parent.Text) == "move" then
  31. byteFlag = 1
  32. end
  33. print("Yikesss")
  34. end
  35.  
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment