Advertisement
DiscordPastebins

keyboardsciript

Jun 8th, 2024
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.81 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 3.2
  3.  
  4. -- Instances:
  5.  
  6. local TouchGui = Instance.new("ScreenGui")
  7. local A = Instance.new("TextLabel")
  8. local D = Instance.new("TextLabel")
  9. local S = Instance.new("TextLabel")
  10. local W = Instance.new("TextLabel")
  11. local Mouse = Instance.new("TextLabel")
  12. local LeftClick = Instance.new("TextLabel")
  13. local RightClick = Instance.new("TextLabel")
  14. local Space = Instance.new("TextLabel")
  15. local Shift = Instance.new("TextLabel")
  16. local RShift = Instance.new("TextLabel")
  17.  
  18. --Properties:
  19.  
  20. TouchGui.Name = "TouchGui"
  21. TouchGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  22. TouchGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  23.  
  24. A.Name = "A"
  25. A.Parent = TouchGui
  26. A.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  27. A.Position = UDim2.new(0.702274323, 0, 0.803736329, 0)
  28. A.Size = UDim2.new(0.0433134809, 0, 0.0890868604, 0)
  29. A.Font = Enum.Font.SourceSans
  30. A.Text = "A"
  31. A.TextColor3 = Color3.fromRGB(0, 0, 0)
  32. A.TextScaled = true
  33. A.TextSize = 14.000
  34. A.TextWrapped = true
  35.  
  36. D.Name = "D"
  37. D.Parent = TouchGui
  38. D.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  39. D.Position = UDim2.new(0.799969554, 0, 0.802622736, 0)
  40. D.Size = UDim2.new(0.0433134809, 0, 0.0902003795, 0)
  41. D.Font = Enum.Font.SourceSans
  42. D.Text = "D"
  43. D.TextColor3 = Color3.fromRGB(0, 0, 0)
  44. D.TextScaled = true
  45. D.TextSize = 14.000
  46. D.TextWrapped = true
  47.  
  48. S.Name = "S"
  49. S.Parent = TouchGui
  50. S.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  51. S.Position = UDim2.new(0.751002014, 0, 0.803736329, 0)
  52. S.Size = UDim2.new(0.0433134809, 0, 0.0890868604, 0)
  53. S.Font = Enum.Font.SourceSans
  54. S.Text = "S"
  55. S.TextColor3 = Color3.fromRGB(0, 0, 0)
  56. S.TextScaled = true
  57. S.TextSize = 14.000
  58. S.TextWrapped = true
  59.  
  60. W.Name = "W"
  61. W.Parent = TouchGui
  62. W.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  63. W.Position = UDim2.new(0.751002014, 0, 0.702122629, 0)
  64. W.Size = UDim2.new(0.0433134809, 0, 0.0890868604, 0)
  65. W.Font = Enum.Font.SourceSans
  66. W.Text = "W"
  67. W.TextColor3 = Color3.fromRGB(0, 0, 0)
  68. W.TextScaled = true
  69. W.TextSize = 14.000
  70. W.TextWrapped = true
  71.  
  72. Mouse.Name = "Mouse"
  73. Mouse.Parent = TouchGui
  74. Mouse.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  75. Mouse.Position = UDim2.new(0.859231114, 0, 0.842984378, 0)
  76. Mouse.Size = UDim2.new(0.06497024, 0, 0.111358657, 0)
  77. Mouse.Font = Enum.Font.SourceSans
  78. Mouse.Text = ""
  79. Mouse.TextColor3 = Color3.fromRGB(0, 0, 0)
  80. Mouse.TextScaled = true
  81. Mouse.TextSize = 14.000
  82. Mouse.TextWrapped = true
  83.  
  84. LeftClick.Name = "LeftClick"
  85. LeftClick.Parent = TouchGui
  86. LeftClick.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  87. LeftClick.Position = UDim2.new(0.859231114, 0, 0.753897488, 0)
  88. LeftClick.Size = UDim2.new(0.0324851125, 0, 0.0890869349, 0)
  89. LeftClick.Font = Enum.Font.SourceSans
  90. LeftClick.Text = ""
  91. LeftClick.TextColor3 = Color3.fromRGB(0, 0, 0)
  92. LeftClick.TextScaled = true
  93. LeftClick.TextSize = 14.000
  94. LeftClick.TextWrapped = true
  95.  
  96. RightClick.Name = "RightClick"
  97. RightClick.Parent = TouchGui
  98. RightClick.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  99. RightClick.Position = UDim2.new(0.891716242, 0, 0.753897488, 0)
  100. RightClick.Size = UDim2.new(0.0324851125, 0, 0.0890869349, 0)
  101. RightClick.Font = Enum.Font.SourceSans
  102. RightClick.Text = ""
  103. RightClick.TextColor3 = Color3.fromRGB(0, 0, 0)
  104. RightClick.TextScaled = true
  105. RightClick.TextSize = 14.000
  106. RightClick.TextWrapped = true
  107.  
  108. Space.Name = "Space"
  109. Space.Parent = TouchGui
  110. Space.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  111. Space.Position = UDim2.new(0.702399433, 0, 0.909799576, 0)
  112. Space.Size = UDim2.new(0.140883535, 0, 0.0668152273, 0)
  113. Space.Font = Enum.Font.SourceSans
  114. Space.Text = ""
  115. Space.TextColor3 = Color3.fromRGB(0, 0, 0)
  116. Space.TextScaled = true
  117. Space.TextSize = 14.000
  118. Space.TextWrapped = true
  119.  
  120. Shift.Name = "Shift"
  121. Shift.Parent = TouchGui
  122. Shift.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  123. Shift.Position = UDim2.new(0.702274323, 0, 0.702206433, 0)
  124. Shift.Size = UDim2.new(0.0433134809, 0, 0.0890868604, 0)
  125. Shift.Font = Enum.Font.SourceSans
  126. Shift.Text = "Shift"
  127. Shift.TextColor3 = Color3.fromRGB(0, 0, 0)
  128. Shift.TextScaled = true
  129. Shift.TextSize = 14.000
  130. Shift.TextWrapped = true
  131.  
  132. RShift.Name = "RShift"
  133. RShift.Parent = TouchGui
  134. RShift.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  135. RShift.Position = UDim2.new(0.799930513, 0, 0.702206433, 0)
  136. RShift.Size = UDim2.new(0.0433134809, 0, 0.0890868604, 0)
  137. RShift.Font = Enum.Font.SourceSans
  138. RShift.Text = "RightShift"
  139. RShift.TextColor3 = Color3.fromRGB(0, 0, 0)
  140. RShift.TextScaled = true
  141. RShift.TextSize = 14.000
  142. RShift.TextWrapped = true
  143.  
  144. -- Scripts:
  145.  
  146. local function PVOHSU_fake_script() -- TouchGui.KeyboardScript
  147. local script = Instance.new('LocalScript', TouchGui)
  148.  
  149. -- Getting the player's mouse and keyboard
  150.  
  151. local uis = game:GetService("UserInputService")
  152. local plr = game.Players.LocalPlayer
  153. local mouse = plr:GetMouse()
  154.  
  155. -- Creating variables
  156.  
  157. local screenGui = script.Parent
  158. local W = screenGui:WaitForChild("W")
  159. local wColor = W.BackgroundColor3
  160. local A = screenGui:WaitForChild("A")
  161. local aColor = A.BackgroundColor3
  162. local S = screenGui:WaitForChild("S")
  163. local sColor = S.BackgroundColor3
  164. local D = screenGui:WaitForChild("D")
  165. local dColor = D.BackgroundColor3
  166. local SP = screenGui:WaitForChild("Space")
  167. local spColor = SP.BackgroundColor3
  168. local Shift = screenGui:WaitForChild("Shift")
  169. local ShiftColor = Shift.BackgroundColor3
  170. local RShift = screenGui:WaitForChild("RShift")
  171. local RShiftColor = RShift.BackgroundColor3
  172.  
  173. local rmb = screenGui:WaitForChild("RightClick")
  174. local rColor = rmb.BackgroundColor3
  175. local lmb = screenGui:WaitForChild("LeftClick")
  176. local lColor = lmb.BackgroundColor3
  177.  
  178. -- Sensing when the mouse is held down
  179. local LeftDown = false -- NOT MANDATORY!!!
  180. local RightDown = false -- NOT MANDATORY!!!
  181.  
  182. mouse.Button1Down:Connect(function()
  183. LeftDown = true -- Sending a signal that the left mouse button is down
  184. lmb.BackgroundColor3 = Color3.fromRGB(100, 100, 100) -- Color, from RGB. Change it if you'd like
  185. mouse.Button1Up:Connect(function()
  186. LeftDown = false -- Sending a signal that the left mouse button is up
  187. lmb.BackgroundColor3 = lColor
  188. end)
  189. end)
  190.  
  191. mouse.Button2Down:Connect(function() -- Same thing for the left mouse button, so I am not going to explain it again
  192. RightDown = true
  193. rmb.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  194. mouse.Button2Up:Connect(function()
  195. RightDown = false
  196. rmb.BackgroundColor3 = rColor
  197. end)
  198. end)
  199.  
  200. --W KEY (This is by far not the simplest way to do it, but it works)
  201.  
  202. uis.InputBegan:Connect(function(inputObj, process)
  203. if inputObj.KeyCode == Enum.KeyCode.W then
  204. W.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  205. end
  206. end)
  207.  
  208. uis.InputEnded:Connect(function(inputObj, process)
  209. if inputObj.KeyCode == Enum.KeyCode.W then
  210. W.BackgroundColor3 = wColor
  211. end
  212. end)
  213.  
  214.  
  215. -- A KEY
  216.  
  217. uis.InputBegan:Connect(function(inputObj, process)
  218. if inputObj.KeyCode == Enum.KeyCode.A then
  219. A.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  220. end
  221. end)
  222.  
  223. uis.InputEnded:Connect(function(inputObj, process)
  224. if inputObj.KeyCode == Enum.KeyCode.A then
  225. A.BackgroundColor3 = aColor
  226. end
  227. end)
  228.  
  229. -- S KEY
  230.  
  231. uis.InputBegan:Connect(function(inputObj, process)
  232. if inputObj.KeyCode == Enum.KeyCode.S then
  233. S.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  234. end
  235. end)
  236.  
  237. uis.InputEnded:Connect(function(inputObj, process)
  238. if inputObj.KeyCode == Enum.KeyCode.S then
  239. S.BackgroundColor3 = sColor
  240. end
  241. end)
  242.  
  243. -- D KEY
  244.  
  245. uis.InputBegan:Connect(function(inputObj, process)
  246. if inputObj.KeyCode == Enum.KeyCode.D then
  247. D.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  248. end
  249. end)
  250.  
  251. uis.InputEnded:Connect(function(inputObj, process)
  252. if inputObj.KeyCode == Enum.KeyCode.D then
  253. D.BackgroundColor3 = dColor
  254. end
  255. end)
  256.  
  257. -- SPACE
  258.  
  259. uis.InputBegan:Connect(function(inputObj, process)
  260. if inputObj.KeyCode == Enum.KeyCode.Space then
  261. SP.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  262. end
  263. end)
  264.  
  265. uis.InputEnded:Connect(function(inputObj, process)
  266. if inputObj.KeyCode == Enum.KeyCode.Space then
  267. SP.BackgroundColor3 = spColor
  268. end
  269. end)
  270.  
  271. -- LEFTSHIFT
  272. uis.InputBegan:Connect(function(inputObj, process)
  273. if inputObj.KeyCode == Enum.KeyCode.LeftShift then
  274. Shift.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  275. end
  276. end)
  277.  
  278. uis.InputEnded:Connect(function(inputObj, process)
  279. if inputObj.KeyCode == Enum.KeyCode.LeftShift then
  280. Shift.BackgroundColor3 = ShiftColor
  281. end
  282. end)
  283.  
  284. -- RIGHTSHIFT
  285. uis.InputBegan:Connect(function(inputObj, process)
  286. if inputObj.KeyCode == Enum.KeyCode.RightShift then
  287. RShift.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  288. end
  289. end)
  290.  
  291. uis.InputEnded:Connect(function(inputObj, process)
  292. if inputObj.KeyCode == Enum.KeyCode.RightShift then
  293. RShift.BackgroundColor3 = RShiftColor
  294. end
  295. end)
  296. end
  297. coroutine.wrap(PVOHSU_fake_script)()
  298.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement