Advertisement
ProtonDev-Sys

Untitled

Dec 7th, 2020
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. local functions = {}
  2.  
  3. local runService = game:GetService("RunService")
  4. local uis = game:GetService("UserInputService")
  5. local mouse = game:GetService("Players")['LocalPlayer']:GetMouse()
  6. local keys = {}
  7.  
  8. uis.InputBegan:Connect(function(k)
  9. keys[k.KeyCode] = true
  10. end)
  11. uis.InputEnded:Connect(function(k)
  12. keys[k.KeyCode] = false
  13. end)
  14.  
  15. function functions:LocalPlayer()
  16. if runService:IsClient() then
  17. return game:GetService("Players").LocalPlayer
  18. end
  19. end;
  20.  
  21. function functions:LocalCharacter()
  22. if runService:IsClient() then
  23. return game:GetService("Players").LocalPlayer.Character or false
  24. end
  25. return false
  26. end
  27.  
  28. function functions:SetWalkSpeed(val)
  29. if runService:IsClient() then
  30. game:GetService("Players").LocalPlayer.Character.Humanoid.WalkSpeed = val
  31. return true
  32. end
  33. return false
  34. end
  35.  
  36. function functions:SetJumpPower(val)
  37. if runService:IsClient() then
  38. game:GetService("Players").LocalPlayer.Character.Humanoid.JumpPower = val
  39. return true
  40. end
  41. return false
  42. end
  43.  
  44.  
  45. function functions:MouseButton1Down()
  46. if runService:IsClient() then
  47. for i , v in pairs(uis:GetMouseButtonsPressed()) do
  48. if v == Enum.UserInputType.MouseButton1 then
  49. return true
  50. end
  51. end
  52. end
  53. return false
  54. end
  55.  
  56. function functions:MouseButton2Down()
  57. if runService:IsClient() then
  58. for i , v in pairs(uis:GetMouseButtonsPressed()) do
  59. if v == Enum.UserInputType.MouseButton2 then
  60. return true
  61. end
  62. end
  63. end
  64. return false
  65. end
  66.  
  67. function functions:MouseButton3Down()
  68. if runService:IsClient() then
  69. for i , v in pairs(uis:GetMouseButtonsPressed()) do
  70. if v == Enum.UserInputType.MouseButton3 then
  71. return true
  72. end
  73. end
  74. end
  75. return false
  76. end
  77.  
  78. function functions:IsKeyDown(key)
  79. if runService:IsClient() then
  80. if key then
  81. return keys[key] or false
  82. else
  83. return false
  84. end
  85. end
  86. end
  87.  
  88. function functions:CreateRemoteEvent(name,parent)
  89. local remote = Instance.new('RemoteEvent')
  90. remote.Name = name
  91. remote.Parent = parent or game.ReplicatedStorage
  92. return remote
  93. end
  94.  
  95. function functions:CreateRemoteFunction(name,parent)
  96. local remote = Instance.new('RemoteFunction')
  97. remote.Name = name
  98. remote.Parent = parent or game.ReplicatedStorage
  99. return remote
  100. end
  101.  
  102. function functions:CreateBindableEvent(name,parent)
  103. local remote = Instance.new('BindableEvent')
  104. remote.Name = name
  105. remote.Parent = parent or game.ReplicatedStorage
  106. return remote
  107. end
  108.  
  109. function functions:CreateBindableFunction(name,parent)
  110. local remote = Instance.new('BindableFunction')
  111. remote.Name = name
  112. remote.Parent = parent or game.ReplicatedStorage
  113. return remote
  114. end
  115.  
  116. function functions:ShakeCamera(times)
  117. if runService:IsClient() then
  118. if times then
  119. for i = 0 , times do
  120. local x = math.random(-100,100)/100
  121. local y = math.random(-100,100)/100
  122. local z = math.random(-100,100)/100
  123. game:GetService("Players").LocalPlayer.Character.Humanoid.CameraOffset = Vector3.new(x,y,z)
  124. wait(.1)
  125. end
  126. game:GetService("Players").LocalPlayer.Character.Humanoid.CameraOffset = Vector3.new(0,0,0)
  127. else
  128. local x = math.random(-100,100)/100
  129. local y = math.random(-100,100)/100
  130. local z = math.random(-100,100)/100
  131. game:GetService("Players").LocalPlayer.Character.Humanoid.CameraOffset = Vector3.new(x,y,z)
  132. wait(.1)
  133. game:GetService("Players").LocalPlayer.Character.Humanoid.CameraOffset = Vector3.new(0,0,0)
  134. end
  135. return true
  136. end
  137. return false
  138. end
  139.  
  140. return functions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement