Advertisement
iiFlamez

Untitled

Oct 29th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.99 KB | None | 0 0
  1. -- params : ...
  2.  
  3. local player = game.Players.LocalPlayer
  4. local character = player.Character
  5. local humanoid = character:WaitForChild("Humanoid")
  6. local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  7. local userInputService = game:GetService("UserInputService")
  8. local contextActionService = game:GetService("ContextActionService")
  9. local replicatedStorage = game:GetService("ReplicatedStorage")
  10. local event = replicatedStorage:WaitForChild("RemoteEvent")
  11. local debounce = require(replicatedStorage:WaitForChild("DebounceModule"))
  12. local animations = replicatedStorage:WaitForChild("Animations")
  13. local animTrackCrawl = humanoid:LoadAnimation(animations:WaitForChild("AnimCrawl"))
  14. local trackTyping = humanoid:LoadAnimation(animations:WaitForChild("AnimTyping"))
  15. local trackCarry = humanoid:LoadAnimation(animations:WaitForChild("AnimCarry"))
  16. local playerStats = require(player:WaitForChild("TempPlayerStatsModule"))
  17. local gui = player.PlayerGui.ScreenGui
  18. local actionBox = gui:WaitForChild("ActionBox")
  19. local progressBox = gui:WaitForChild("ProgressBox")
  20. local onTrigger = false
  21. CrawlFunction = function(actionName, actionInputState, actionInputObject)
  22. -- DECOMPILER ERROR at PC20: Unhandled construct in 'MakeBoolean' P1
  23.  
  24. if userInputService.TouchEnabled == true and actionInputState == Enum.UserInputState.Begin then
  25. if playerStats.GetValue("IsCrawling") == true then
  26. event:FireServer("Input", "Crawl", false)
  27. humanoid.HipHeight = 0
  28. animTrackCrawl:Stop()
  29. humanoid.WalkSpeed = 16
  30. else
  31. event:FireServer("Input", "Crawl", true)
  32. humanoid.HipHeight = -2
  33. animTrackCrawl:Play(0.100000001, 1, 0)
  34. humanoid.WalkSpeed = 8
  35. end
  36. end
  37. if actionInputState == Enum.UserInputState.Begin then
  38. event:FireServer("Input", "Crawl", true)
  39. humanoid.HipHeight = -2
  40. animTrackCrawl:Play(0.100000001, 1, 0)
  41. humanoid.WalkSpeed = 8
  42. else
  43. if actionInputState == Enum.UserInputState.End then
  44. event:FireServer("Input", "Crawl", false)
  45. humanoid.HipHeight = 0
  46. animTrackCrawl:Stop()
  47. humanoid.WalkSpeed = 16
  48. end
  49. end
  50. end
  51.  
  52. ActionFunction = function(actionName, actionInputState, actionInputObject)
  53. -- DECOMPILER ERROR at PC13: Unhandled construct in 'MakeBoolean' P1
  54.  
  55. if actionInputState == Enum.UserInputState.Begin and onTrigger == true then
  56. event:FireServer("Input", "Action", true)
  57. playerStats.SetValue("ActionInput", true)
  58. end
  59. if actionInputState == Enum.UserInputState.End then
  60. event:FireServer("Input", "Action", false)
  61. end
  62. end
  63.  
  64. SetupMobileButtons = function()
  65. if userInputService.TouchEnabled == true then
  66. player.PlayerGui:WaitForChild("TouchGui")
  67. local isSmallScreen = player.PlayerGui.TouchGui.TouchControlFrame.AbsoluteSize.Y <= 500
  68. local buttonSize = isSmallScreen and 70 or 120
  69. if isSmallScreen then
  70. if contextActionService:GetButton("Crawl") then
  71. contextActionService:SetPosition("Crawl", UDim2.new(1, -3 * buttonSize - 10, 1, -buttonSize - 20))
  72. end
  73. if contextActionService:GetButton("Action") then
  74. contextActionService:SetPosition("Action", UDim2.new(1, -2 * buttonSize - 10, 1, -buttonSize - 20))
  75. end
  76. else
  77. if contextActionService:GetButton("Crawl") then
  78. contextActionService:SetPosition("Crawl", UDim2.new(1, -2 * buttonSize - 10, 1, -buttonSize))
  79. end
  80. if contextActionService:GetButton("Action") then
  81. contextActionService:SetPosition("Action", UDim2.new(1, -2 * buttonSize - 10, 1, -2 * buttonSize + 20))
  82. end
  83. end
  84. end
  85. -- DECOMPILER ERROR: 7 unprocessed JMP targets
  86. end
  87.  
  88. TriggerTouch = function(hit, touched, forceQuit)
  89. if forceQuit or playerStats.GetValue("DisableInteraction") == true then
  90. onTrigger = false
  91. actionBox.Visible = false
  92. actionBox.Text = ""
  93. event:FireServer("Input", "Trigger", false)
  94. else
  95. if string.match(hit.Name, "Trigger") and onTrigger ~= touched then
  96. onTrigger = touched
  97. if touched == false then
  98. progressBox.Visible = false
  99. else
  100. UpdateActionBox(hit:FindFirstChild("ActionSign").Value)
  101. spawn(function()
  102. local triggerActionSign = hit:FindFirstChild("ActionSign")
  103. local currentTriggerValue = triggerActionSign.Value
  104. while onTrigger == true do
  105. if currentTriggerValue ~= triggerActionSign.Value then
  106. currentTriggerValue = triggerActionSign.Value
  107. UpdateActionBox(currentTriggerValue)
  108. end
  109. wait()
  110. end
  111. actionBox.Visible = false
  112. actionBox.Text = ""
  113. end)
  114. end
  115. event:FireServer("Input", "Trigger", touched, hit:FindFirstChild("Event"))
  116. end
  117. end
  118. end
  119.  
  120. UpdateActionBox = function(actionValue)
  121. if actionValue then
  122. actionBox.Visible = true
  123. if actionValue == 10 then
  124. actionBox.Text = "Open Door"
  125. else
  126. if actionValue == 11 then
  127. actionBox.Text = "Close Door"
  128. else
  129. if actionValue == 12 then
  130. if playerStats.GetValue("IsBeast") then
  131. actionBox.Visible = false
  132. actionBox.Text = ""
  133. else
  134. actionBox.Text = "Open Exit"
  135. end
  136. else
  137. if actionValue == 20 then
  138. if playerStats.GetValue("IsBeast") then
  139. actionBox.Visible = false
  140. actionBox.Text = ""
  141. else
  142. actionBox.Text = "Hack"
  143. end
  144. else
  145. if actionValue == 30 then
  146. if playerStats.GetValue("IsBeast") then
  147. if character:FindFirstChild("CarriedTorso").Value == nil then
  148. actionBox.Visible = false
  149. actionBox.Text = ""
  150. else
  151. actionBox.Text = "Trap"
  152. end
  153. else
  154. actionBox.Visible = false
  155. actionBox.Text = ""
  156. end
  157. else
  158. if actionValue == 31 then
  159. if playerStats.GetValue("IsBeast") then
  160. actionBox.Visible = false
  161. actionBox.Text = ""
  162. else
  163. actionBox.Text = "Free"
  164. end
  165. else
  166. actionBox.Visible = false
  167. actionBox.Text = ""
  168. end
  169. end
  170. end
  171. end
  172. end
  173. end
  174. end
  175. end
  176.  
  177. event.OnClientEvent:connect(function(...)
  178. local tuple = {...}
  179. end)
  180. playerStats.Get("CurrentAnimation").Changed:connect(function()
  181. if playerStats.GetValue("CurrentAnimation") == "Typing" then
  182. trackTyping:Play(0.100000001, 1, 6)
  183. else
  184. if playerStats.GetValue("CurrentAnimation") == "Carry" then
  185. trackCarry:Play()
  186. else
  187. trackTyping:Stop()
  188. trackCarry:Stop()
  189. end
  190. end
  191. end)
  192. humanoid.Running:connect(function(speed)
  193. if speed > 0.5 then
  194. animTrackCrawl:AdjustSpeed(2)
  195. else
  196. animTrackCrawl:AdjustSpeed(0)
  197. end
  198. end)
  199. contextActionService:BindAction("Crawl, CrawlFunction, true, Enum.KeyCode.LeftShift, Enum.KeyCode.ButtonL2)
  200. contextActionService:SetTitle("Crawl, "C")
  201. contextActionService:BindAction("Action, ActionFunction, true, Enum.KeyCode.E, Enum.KeyCode.ButtonX)
  202. contextActionService:SetTitle("Action, "E")
  203. playerStats.Get("DisableCrawl").Changed:connect(function()
  204. if playerStats.GetValue("DisableCrawl") == true then
  205. event:FireServer("Input", "Crawl", false)
  206. humanoid.HipHeight = 0
  207. animTrackCrawl:Stop()
  208. humanoid.WalkSpeed = 16
  209. contextActionService:UnbindAction("Crawl")
  210. else
  211. contextActionService:BindAction("Crawl", CrawlFunction, true, Enum.KeyCode.LeftShift, Enum.KeyCode.ButtonL2)
  212. contextActionService:SetTitle("Crawl", "C")
  213. SetupMobileButtons()
  214. end
  215. end)
  216. playerStats.Get("DisableInteraction").Changed:connect(function()
  217. if playerStats.GetValue("DisableInteraction") == true then
  218. event:FireServer("Input", "Action", false)
  219. TriggerTouch(nil, false, true)
  220. contextActionService:UnbindAction("Action")
  221. else
  222. contextActionService:BindAction("Action", ActionFunction, true, Enum.KeyCode.E, Enum.KeyCode.ButtonX)
  223. contextActionService:SetTitle("Action", "E")
  224. SetupMobileButtons()
  225. end
  226. end)
  227. character.Torso.Touched:connect(function(hit)
  228. TriggerTouch(hit, true, false)
  229. end)
  230. character.Torso.TouchEnded:connect(function(hit)
  231. TriggerTouch(hit, false, false)
  232. end)
  233. playerStats.Get("Ragdoll").Changed:connect(function()
  234. if playerStats.GetValue("Ragdoll") == true then
  235. humanoid.JumpPower = 0
  236. else
  237. humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
  238. humanoid.JumpPower = 36
  239. end
  240. end)
  241. wait(1)
  242. SetupMobileButtons()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement