AALTTz

Have people control you

Oct 6th, 2022
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.38 KB | None | 0 0
  1. --credits: Snip#3132
  2. -- Editted By Creo ^ Credits to creator above
  3. --Commands: move forward, -move backward, -move leftward, -move rightward, -shiftlock on, -shiftlock off, -stop moving, -dance, -dance1, -dance2, -dance3, -wave, -point, -laugh, -jump, -joke
  4. local chat = function(MSG) -- creo thing
  5. game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer(MSG, "All")
  6. end
  7. chat("You can now control me!! Type commands below to do so.")
  8. chat("Commands: -move forward, -move backward, -move leftward, -move rightward, -jump, -joke")
  9. chat("-shiftlock on, -shiftlock off, -stop moving, -dance, -dance1, -dance2, -dance3")
  10. local keys = {
  11. ["a"] = 0x41,
  12. ["b"] = 0x42,
  13. ["c"] = 0x43,
  14. ["d"] = 0x44,
  15. ["e"] = 0x45,
  16. ["f"] = 0x46,
  17. ["g"] = 0x47,
  18. ["h"] = 0x48,
  19. ["i"] = 0x49,
  20. ["j"] = 0x4A,
  21. ["k"] = 0x4B,
  22. ["l"] = 0x4C,
  23. ["m"] = 0x4D,
  24. ["n"] = 0x4E,
  25. ["o"] = 0x4F,
  26. ["p"] = 0x50,
  27. ["q"] = 0x51,
  28. ["r"] = 0x52,
  29. ["s"] = 0x53,
  30. ["t"] = 0x54,
  31. ["u"] = 0x55,
  32. ["v"] = 0x56,
  33. ["w"] = 0x57,
  34. ["x"] = 0x58,
  35. ["y"] = 0x59,
  36. ["z"] = 0x5A,
  37. ["0"] = 0x30,
  38. ["1"] = 0x31,
  39. ["2"] = 0x32,
  40. ["3"] = 0x33,
  41. ["4"] = 0x34,
  42. ["5"] = 0x35,
  43. ["6"] = 0x36,
  44. ["7"] = 0x37,
  45. ["8"] = 0x38,
  46. ["9"] = 0x39,
  47. ["+"] = 0xBB,
  48. ["-"] = 0xBD,
  49. [","] = 0xBC,
  50. ["."] = 0xBE,
  51. ["quote"] = 0xDE,
  52. ["esc"] = 0x1B,
  53. ["tab"] = 0x09,
  54. ["caps"] = 0x14,
  55. ["lshift"] = 0xA0,
  56. ["rshift"] = 0xA1,
  57. ["ctrl"] = 0x11,
  58. ["lctrl"] = 0xA2,
  59. ["rctrl"] = 0xA3,
  60. ["lwin"] = 0x5B,
  61. ["rwin"] = 0x5C,
  62. ["alt"] = 0x12,
  63. ["space"] = 0x20,
  64. ["enter"] = 0x0D,
  65. ["backspace"] = 0x08,
  66. ["sshot"] = 0x2C,
  67. ["scrolllock"] = 0x91,
  68. ["pause"] = 0x13,
  69. ["insert"] = 0x2D,
  70. ["home"] = 0x24,
  71. ["pgup"] = 0x21,
  72. ["del"] = 0x2E,
  73. ["end"] = 0x23,
  74. ["pgdn"] = 0x22,
  75. ["up_a"] = 0x26,
  76. ["down_a"] = 0x28,
  77. ["left_a"] = 0x25,
  78. ["right_a"] = 0x27,
  79. ["numlock"] = 0x90,
  80. ["sleep"] = 0x5F,
  81. ["n_0"] = 0x60,
  82. ["n_1"] = 0x61,
  83. ["n_2"] = 0x62,
  84. ["n_3"] = 0x63,
  85. ["n_4"] = 0x64,
  86. ["n_5"] = 0x65,
  87. ["n_6"] = 0x66,
  88. ["n_7"] = 0x67,
  89. ["n_8"] = 0x68,
  90. ["n_9"] = 0x69,
  91. ["v_mute"] = 0xAD,
  92. ["v_up"] = 0xAF,
  93. ["v_down"] = 0xAE,
  94. ["next_t"] = 0xB0,
  95. ["prev_t"] = 0xB1,
  96. ["stop_t"] = 0xB2,
  97. ["pause_t"] = 0xB3,
  98. ["f1"] = 0x70,
  99. ["f2"] = 0x71,
  100. ["f3"] = 0x72,
  101. ["f4"] = 0x73,
  102. ["f5"] = 0x74,
  103. ["f6"] = 0x75,
  104. ["f7"] = 0x76,
  105. ["f8"] = 0x77,
  106. ["f9"] = 0x78,
  107. ["f10"] = 0x79,
  108. ["f11"] = 0x7A,
  109. ["f12"] = 0x7B,
  110. }
  111.  
  112. function hold(mousebutton)
  113. if mousebutton == "left" then
  114. mouse1down()
  115. elseif mousebutton == "right" then
  116. mouse2down()
  117. end
  118. end
  119.  
  120. function release(mousebutton)
  121. if mousebutton == "left" then
  122. mouse1up()
  123. elseif mousebutton == "right" then
  124. mouse2up()
  125. end
  126. end
  127.  
  128. function click(mousebutton)
  129. if mousebutton == "left" then
  130. mouse1click()
  131. elseif mousebutton == "right" then
  132. mouse2click()
  133. end
  134. end
  135.  
  136. function move(x,y)
  137. mousemoveabs(x,y)
  138. end
  139.  
  140. function scroll(p)
  141. mousescroll(p)
  142. end
  143.  
  144. function loopmove(x,y)
  145. if canmove2 ~= false then
  146. canmove1 = false
  147. spawn(function()
  148. local l
  149. l = game:GetService("RunService").Heartbeat:Connect(function()
  150. if canmove1 == true then
  151. l:Disconnect()
  152. end
  153. wait()
  154. move(x,y)
  155. end)
  156. end)
  157. end
  158. end
  159.  
  160. function breakmove()
  161. canmove1 = false
  162. end
  163.  
  164. local mouse = game:GetService("Players").LocalPlayer:GetMouse()
  165. canmove2 = true
  166. function togglemove()
  167. if canmove1 ~= false then
  168. if canmove2 == false then
  169. canmove2 = true
  170. elseif canmove2 == true then
  171. canmove2 = false
  172. mx = mouse.X
  173. my = mouse.Y
  174. spawn(function()
  175. local l
  176. l = game:GetService("RunService").Heartbeat:Connect(function()
  177. if canmove2 == true then
  178. l:Disconnect()
  179. end
  180. wait()
  181. move(mx,my)
  182. end)
  183. end)
  184. end
  185. end
  186. end
  187.  
  188. function type(string)
  189. for _,char in pairs(string:split("")) do
  190. wait(0.01)
  191. if char == " " then
  192. keypress(keys["space"])
  193. else
  194. if char:upper() == char and (char ~= "," and char ~= "." and char ~= "-" and char ~= "+" and char ~= "'" and char ~= '"' and char ~= "<" and char ~= ">" and char ~= "_" and char ~= "=") then
  195. keypress(keys["lshift"])
  196. keypress(keys[char:lower()])
  197. keyrelease(keys["lshift"])
  198. else
  199. if char == "'" then
  200. keyrelease(keys["caps"])
  201. keyrelease(keys["lshift"])
  202. keypress(keys["quote"])
  203. elseif char == '"' then
  204. keyrelease(keys["caps"])
  205. keypress(keys["lshift"])
  206. keypress(keys["quote"])
  207. keyrelease(keys["lshift"])
  208. elseif char == "<" then
  209. keyrelease(keys["caps"])
  210. keypress(keys["lshift"])
  211. keypress(keys[","])
  212. keyrelease(keys["lshift"])
  213. elseif char == ">" then
  214. keyrelease(keys["caps"])
  215. keypress(keys["lshift"])
  216. keypress(keys["."])
  217. keyrelease(keys["lshift"])
  218. elseif char == "_" then
  219. keyrelease(keys["caps"])
  220. keypress(keys["lshift"])
  221. keypress(keys["-"])
  222. keyrelease(keys["lshift"])
  223. elseif char == "=" then
  224. keyrelease(keys["caps"])
  225. keypress(keys["lshift"])
  226. keypress(keys["+"])
  227. keyrelease(keys["lshift"])
  228. else
  229. keyrelease(keys["caps"])
  230. keyrelease(keys["lshift"])
  231. keypress(keys[char])
  232. end
  233. end
  234. end
  235. end
  236. end
  237.  
  238.  
  239.  
  240. local chatEvents = game:GetService("ReplicatedStorage"):WaitForChild("DefaultChatSystemChatEvents")
  241. local messageDoneFiltering = chatEvents:WaitForChild("OnMessageDoneFiltering")
  242.  
  243. messageDoneFiltering.OnClientEvent:Connect(function(message)
  244. local msg = message.Message or ""
  245.  
  246.  
  247.  
  248. print(msg)
  249. if msg:lower():sub(1,13) == "-move forward" then
  250. keyrelease(keys["s"])
  251. keypress(keys["w"])
  252. end
  253.  
  254. if msg:lower():sub(1,14) == "-move backward" then
  255. keyrelease(keys["w"])
  256. keypress(keys["s"])
  257. end
  258.  
  259. if msg:lower():sub(1,14) == "-move leftward" then
  260. keyrelease(keys["d"])
  261. keypress(keys["a"])
  262. end
  263.  
  264. if msg:lower():sub(1,15) == "-move rightward" then
  265. keyrelease(keys["a"])
  266. keypress(keys["d"])
  267. end
  268.  
  269. if msg:lower():sub(1,13) == "-shiftlock on" then
  270. keypress(keys["lshift"])
  271. keyrelease(keys["lshift"])
  272. end
  273.  
  274. if msg:lower():sub(1,14) == "-shiftlock off" then
  275. keypress(keys["lshift"])
  276. keyrelease(keys["lshift"])
  277. end
  278.  
  279. if msg:lower():sub(1,12) == "-stop moving" then
  280. keyrelease(keys["w"])
  281. keyrelease(keys["s"])
  282. keyrelease(keys["a"])
  283. keyrelease(keys["d"])
  284. end
  285.  
  286. if msg:lower():sub(1,5) == "-wave" then
  287. game.Players:Chat("/e wave")
  288. end
  289.  
  290. if msg:lower():sub(1,6) == "-point" then
  291. game.Players:Chat("/e point")
  292. end
  293.  
  294. if msg:lower():sub(1,6) == "-laugh" then
  295. game.Players:Chat("/e laugh")
  296. end
  297.  
  298. if msg:lower():sub(1,6) == "-dance" then
  299. game.Players:Chat("/e dance")
  300. end
  301.  
  302. if msg:lower():sub(1,7) == "-dance1" then
  303. game.Players:Chat("/e dance1")
  304. end
  305.  
  306. if msg:lower():sub(1,7) == "-dance2" then
  307. game.Players:Chat("/e dance2")
  308. end
  309.  
  310. if msg:lower():sub(1,7) == "-dance3" then
  311. game.Players:Chat("/e dance3")
  312. end
  313.  
  314. if msg:lower():sub(1,12) == "-rotate left" then
  315. keyrelease(keys["right_a"])
  316. keypress(keys["left_a"])
  317. end
  318.  
  319. if msg:lower():sub(1,13) == "-rotate right" then
  320. keyrelease(keys["left_a"])
  321. keypress(keys["right_a"])
  322. end
  323.  
  324. if msg:lower():sub(1,12) == "-rotate stop" then
  325. keyrelease(keys["right_a"])
  326. keyrelease(keys["left_a"])
  327. end
  328.  
  329. if msg:lower():sub(1,5) == "-jump" then
  330. keypress(keys["space"])
  331. wait(0.1)
  332. keyrelease(keys["space"])
  333. end
  334.  
  335. end)
Add Comment
Please, Sign In to add comment