Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local uis = game:GetService("UserInputService")
- local byteFlag = 0
- local xByte = 0
- local yByte = 0
- uis.InputBegan:Connect(function(key)
- if byteFlag == 1 then
- if script.Parent.Text then
- xByte = script.Parent.Text
- byteFlag = 2
- print(xByte)
- end
- end
- if byteFlag == 2 then
- if key.KeyCode == Enum.KeyCode.Return then
- local yByte = script.Parent.Text
- byteFlag = 3
- print(yByte)
- end
- end
- if byteFlag == 3 then
- script.Parent.Parent.Position.X = script.Parent.Parent.Position.X + xByte
- script.Parent.Parent.Position.Y = script.Parent.Parent.Position.Y + yByte
- byteFlag = 0
- end
- if key.KeyCode == Enum.KeyCode.Return and byteFlag == 0 then
- --Blah blah blah code stuff
- if string.lower(script.Parent.Text) == "move" then
- byteFlag = 1
- end
- print("Yikesss")
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment