Advertisement
Guest User

Untitled

a guest
Sep 5th, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.40 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. do local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  6. --[[
  7. Watch
  8. Zomg a watch.
  9. --]]
  10.  
  11.  
  12. if script == nil then return end
  13.  
  14.  
  15. ModelName = "Watch"
  16. Player = Game.Players.LocalPlayer
  17. Char = Player.Character
  18. animate = Char:findFirstChild("Animate")
  19. if animate then
  20. animate:Destroy()
  21. end
  22. Selected = false
  23. Connected = false
  24. Button1Down = false
  25. CanUse = true
  26. WatchColor = BrickColor.new("Really black")
  27. FaceColor = BrickColor.new("Really black")
  28. FaceBackColor = BrickColor.new("Really black")
  29. CenterHandColor = BrickColor.new("Really black")
  30. NotchColor1 = BrickColor.new("Bright green")
  31. NotchColor2 = BrickColor.new("Bright green")
  32. HourHandColor = BrickColor.new("Really black")
  33. MinuteHandColor = BrickColor.new("Really black")
  34. SecondHandColor = BrickColor.new("Really red")
  35.  
  36.  
  37.  
  38. function CheckPlayer()
  39. if Player.Character == nil then return false end
  40. if Player.Character:FindFirstChild("Torso") == nil or Player.Character:FindFirstChild("Right Arm") == nil or Player.Character:FindFirstChild("Humanoid") == nil then return false end
  41. if Player.Character.Humanoid.Health <= 0 then return false end
  42. return true
  43. end
  44.  
  45.  
  46.  
  47.  
  48. function Time()
  49. local Hours = math.floor((tick() / 3600) % 24)
  50. local Minutes = math.floor((tick() % 3600) / 60)
  51. local Seconds = math.floor(tick() % 60)
  52. local Section = ""
  53. if Hours == 24 or Hours < 12 then
  54. Section = "AM"
  55. else
  56. Section = "PM"
  57. end
  58. if Hours > 12 then
  59. Hours = Hours - 12
  60. end
  61. if Minutes <= 9 then
  62. Minutes = "0" ..tostring(Minutes)
  63. end
  64. if Seconds <= 9 then
  65. Seconds = "0" ..tostring(Seconds)
  66. end
  67. return Hours, Minutes, Seconds, Section
  68. end
  69.  
  70.  
  71. function CreateParts(Parent, Format)
  72. if Parent == nil then return end
  73. local Parts = Instance.new("Model")
  74. Parts.Name = ModelName
  75. if Format == 1 then
  76. Parts.Name = Parts.Name.. " (Holstered)"
  77. end
  78. Parts.Parent = Player.Character
  79.  
  80. local MasterPart1 = Instance.new("Part")
  81. MasterPart1.Material = "Neon"
  82. MasterPart1.Name = "Handle"
  83. MasterPart1.FormFactor = "Custom"
  84. MasterPart1.Size = Vector3.new(1.1, 0.2, 1.1)
  85. MasterPart1.BrickColor = WatchColor
  86. MasterPart1.TopSurface = 0
  87. MasterPart1.BottomSurface = 0
  88. MasterPart1.Parent = Parts
  89. Instance.new("BlockMesh", MasterPart1)
  90. local Weld = Instance.new("Weld", MasterPart1)
  91. Weld.Part0 = Weld.Parent
  92. Weld.Part1 = Player.Character:FindFirstChild("Right Arm")
  93. Weld.C0 = CFrame.new(0, 0.7, 0)
  94.  
  95. local MasterPart2 = Instance.new("Part")
  96. MasterPart2.Material = "Neon"
  97. MasterPart2.Name = "Watch"
  98. MasterPart2.FormFactor = "Custom"
  99. MasterPart2.Size = Vector3.new(0.5, 0.21, 0.5)
  100. MasterPart2.BrickColor = WatchColor
  101. MasterPart2.TopSurface = 0
  102. MasterPart2.BottomSurface = 0
  103. MasterPart2.Parent = Parts
  104. Instance.new("CylinderMesh", MasterPart2)
  105. local Weld = Instance.new("Weld", MasterPart2)
  106. Weld.Part0 = Weld.Parent
  107. Weld.Part1 = MasterPart1
  108. Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(90), 0) * CFrame.new(-0.5, 0, 0)
  109.  
  110. for i = 0, 360, 15 do
  111. local Part = Instance.new("Part")
  112. Part.Material = "Neon"
  113. Part.Name = "Face Rim"
  114. Part.FormFactor = "Custom"
  115. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  116. Part.BrickColor = WatchColor
  117. Part.TopSurface = 0
  118. Part.BottomSurface = 0
  119. Part.Parent = Parts
  120. Instance.new("BlockMesh", Part).Scale = Vector3.new(0.065 / 0.2, 0.03 / 0.2, 0.05 / 0.2)
  121. local Weld = Instance.new("Weld", Part)
  122. Weld.Part0 = Weld.Parent
  123. Weld.Part1 = MasterPart2
  124. Weld.C0 = CFrame.new(0, 0.12, 0.224) * CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0)
  125. end
  126.  
  127. local Part = Instance.new("Part")
  128. Part.Material = "Neon"
  129. Part.Name = "Face"
  130. Part.FormFactor = "Custom"
  131. Part.Size = Vector3.new(0.4, 0.2, 0.4)
  132. Part.BrickColor = FaceColor
  133. Part.Transparency = 0.8
  134. Part.TopSurface = 0
  135. Part.BottomSurface = 0
  136. Part.Parent = Parts
  137. Instance.new("CylinderMesh", Part).Scale = Vector3.new(1, 0.06 / 0.2, 1)
  138. local Weld = Instance.new("Weld", Part)
  139. Weld.Part0 = Weld.Parent
  140. Weld.Part1 = MasterPart2
  141. Weld.C0 = CFrame.new(0, 0.1, 0)
  142.  
  143. local Part = Instance.new("Part")
  144. Part.Material = "Neon"
  145. Part.Name = "Face Back"
  146. Part.FormFactor = "Custom"
  147. Part.Size = Vector3.new(0.4, 0.2, 0.4)
  148. Part.BrickColor = FaceBackColor
  149. Part.TopSurface = 0
  150. Part.BottomSurface = 0
  151. Part.Parent = Parts
  152. Instance.new("CylinderMesh", Part).Scale = Vector3.new(1, 0.0105 / 0.2, 1)
  153. local Weld = Instance.new("Weld", Part)
  154. Weld.Part0 = Weld.Parent
  155. Weld.Part1 = MasterPart2
  156. Weld.C0 = CFrame.new(0, 0.1, 0)
  157.  
  158. local Part = Instance.new("Part")
  159. Part.Material = "Neon"
  160. Part.Name = "Hand Center"
  161. Part.FormFactor = "Custom"
  162. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  163. Part.BrickColor = CenterHandColor
  164. Part.TopSurface = 0
  165. Part.BottomSurface = 0
  166. Part.Parent = Parts
  167. Instance.new("CylinderMesh", Part).Scale = Vector3.new(0.035 / 0.2, 0.04 / 0.2, 0.035 / 0.2)
  168. local Weld = Instance.new("Weld", Part)
  169. Weld.Part0 = Weld.Parent
  170. Weld.Part1 = MasterPart2
  171. Weld.C0 = CFrame.new(0, 0.1, 0)
  172.  
  173. for i = 0, 360, 360 / 20 do
  174. if i % (360 / 4) ~= 0 then
  175. local Part = Instance.new("Part")
  176. Part.Material = "Neon"
  177. Part.Name = "Notch 1"
  178. Part.FormFactor = "Custom"
  179. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  180. Part.BrickColor = NotchColor1
  181. Part.TopSurface = 0
  182. Part.BottomSurface = 0
  183. Part.Parent = Parts
  184. Instance.new("BlockMesh", Part).Scale = Vector3.new(0.01 / 0.2, 0.01075 / 0.2, 0.03 / 0.2)
  185. local Weld = Instance.new("Weld", Part)
  186. Weld.Part0 = Weld.Parent
  187. Weld.Part1 = MasterPart2
  188. Weld.C0 = CFrame.new(0, 0.1, 0.17) * CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0)
  189. end
  190. end
  191.  
  192. for i = 0, 360, 360 / 4 do
  193. local Part = Instance.new("Part")
  194. Part.Material = "Neon"
  195. Part.Name = "Notch 2"
  196. Part.FormFactor = "Custom"
  197. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  198. Part.BrickColor = NotchColor2
  199. Part.TopSurface = 0
  200. Part.BottomSurface = 0
  201. Part.Parent = Parts
  202. Instance.new("BlockMesh", Part).Scale = Vector3.new(0.02 / 0.2, 0.011 / 0.2, 0.05 / 0.2)
  203. local Weld = Instance.new("Weld", Part)
  204. Weld.Part0 = Weld.Parent
  205. Weld.Part1 = MasterPart2
  206. Weld.C0 = CFrame.new(0, 0.1, 0.17) * CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0)
  207. end
  208.  
  209. local Part = Instance.new("Part")
  210. Part.Material = "Neon"
  211. Part.Name = "Hand Hour"
  212. Part.FormFactor = "Custom"
  213. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  214. Part.BrickColor = HourHandColor
  215. Part.TopSurface = 0
  216. Part.BottomSurface = 0
  217. Part.Parent = Parts
  218. Instance.new("BlockMesh", Part).Scale = Vector3.new(0.03 / 0.2, 0.015 / 0.2, 0.1 / 0.2)
  219. local Weld = Instance.new("Weld", Part)
  220. Weld.Part0 = Weld.Parent
  221. Weld.Part1 = MasterPart2
  222. Weld.C0 = CFrame.new(0, 0.11, 0.05)
  223.  
  224. local Part = Instance.new("Part")
  225. Part.Material = "Neon"
  226. Part.Name = "Hand Minute"
  227. Part.FormFactor = "Custom"
  228. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  229. Part.BrickColor = MinuteHandColor
  230. Part.TopSurface = 0
  231. Part.BottomSurface = 0
  232. Part.Parent = Parts
  233. Instance.new("BlockMesh", Part).Scale = Vector3.new(0.02 / 0.2, 0.0125 / 0.2, 0.15 / 0.2)
  234. local Weld = Instance.new("Weld", Part)
  235. Weld.Part0 = Weld.Parent
  236. Weld.Part1 = MasterPart2
  237. Weld.C0 = CFrame.new(0, 0.11, 0.075)
  238.  
  239. local Part = Instance.new("Part")
  240. Part.Material = "Neon"
  241. Part.Name = "Hand Second"
  242. Part.FormFactor = "Custom"
  243. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  244. Part.BrickColor = SecondHandColor
  245. Part.TopSurface = 0
  246. Part.BottomSurface = 0
  247. Part.Parent = Parts
  248. Instance.new("BlockMesh", Part).Scale = Vector3.new(0.01 / 0.2, 0.01 / 0.2, 0.17 / 0.2)
  249. local Weld = Instance.new("Weld", Part)
  250. Weld.Part0 = Weld.Parent
  251. Weld.Part1 = MasterPart2
  252. Weld.C0 = CFrame.new(0, 0.11, 0.085)
  253.  
  254. for _, Part in pairs(Parts:GetChildren()) do
  255. Part.Locked = true
  256. Part.CanCollide = false
  257. end
  258.  
  259. coroutine.wrap(function()
  260. while Parts.Parent ~= nil do
  261. local Hours, Minutes, Seconds = Time()
  262. --SoundToServer("Tick", "http://www.roblox.com/Asset/?id=14863866", 5, 0.5, false, Parts:FindFirstChild("Watch"))
  263. pcall(function() Parts["Hand Hour"].Weld.C1 = CFrame.fromEulerAnglesXYZ(0, (math.pi * (Hours / 12) * 2) - math.rad(90), 0) end)
  264. pcall(function() Parts["Hand Minute"].Weld.C1 = CFrame.fromEulerAnglesXYZ(0, (math.pi * (Minutes / 60) * 2) - math.rad(90), 0) end)
  265. pcall(function() Parts["Hand Second"].Weld.C1 = CFrame.fromEulerAnglesXYZ(0, (math.pi * (Seconds / 60) * 2) - math.rad(90), 0) end)
  266. wait(1)
  267. end
  268. end)()
  269. end
  270.  
  271.  
  272. function RemoveParts(Parent, Format)
  273. if Format == 1 then
  274. pcall(function() Parent[ModelName.. " (Holstered)"]:Remove() end)
  275. elseif Format == 2 then
  276. pcall(function() Parent[ModelName]:Remove() end)
  277. end
  278. end
  279.  
  280.  
  281. function SetAngle(Joint, Angle, Character)
  282. if Character == nil then return false end
  283. local Joints = {
  284. Character.Torso:FindFirstChild("Right Shoulder 2"),
  285. Character.Torso:FindFirstChild("Left Shoulder 2"),
  286. Character.Torso:FindFirstChild("Right Hip 2"),
  287. Character.Torso:FindFirstChild("Left Hip 2")
  288. }
  289. if Joints[Joint] == nil then return false end
  290. if Joint == 1 or Joint == 3 then
  291. Joints[Joint].DesiredAngle = Angle
  292. end
  293. if Joint == 2 or Joint == 4 then
  294. Joints[Joint].DesiredAngle = -Angle
  295. end
  296. end
  297.  
  298.  
  299. function ForceAngle(Joint, Angle, Character)
  300. if Character == nil then return false end
  301. local Joints = {
  302. Character.Torso:FindFirstChild("Right Shoulder 2"),
  303. Character.Torso:FindFirstChild("Left Shoulder 2"),
  304. Character.Torso:FindFirstChild("Right Hip 2"),
  305. Character.Torso:FindFirstChild("Left Hip 2")
  306. }
  307. if Joints[Joint] == nil then return false end
  308. if Joint == 1 or Joint == 3 then
  309. Joints[Joint].DesiredAngle = Angle
  310. Joints[Joint].CurrentAngle = Angle
  311. end
  312. if Joint == 2 or Joint == 4 then
  313. Joints[Joint].DesiredAngle = -Angle
  314. Joints[Joint].CurrentAngle = -Angle
  315. end
  316. end
  317.  
  318.  
  319. function SetSpeed(Joint, Speed, Character)
  320. if Character == nil then return false end
  321. local Joints = {
  322. Character.Torso:FindFirstChild("Right Shoulder 2"),
  323. Character.Torso:FindFirstChild("Left Shoulder 2"),
  324. Character.Torso:FindFirstChild("Right Hip 2"),
  325. Character.Torso:FindFirstChild("Left Hip 2")
  326. }
  327. if Joints[Joint] == nil then return false end
  328. Joints[Joint].MaxVelocity = Speed
  329. end
  330.  
  331.  
  332. function DisableLimb(Limb, Character)
  333. if Character == nil then return false end
  334. if Character:FindFirstChild("Torso") == nil then return false end
  335. local Joints = {
  336. Character.Torso:FindFirstChild("Right Shoulder"),
  337. Character.Torso:FindFirstChild("Left Shoulder"),
  338. Character.Torso:FindFirstChild("Right Hip"),
  339. Character.Torso:FindFirstChild("Left Hip")
  340. }
  341. local Limbs = {
  342. Character:FindFirstChild("Right Arm"),
  343. Character:FindFirstChild("Left Arm"),
  344. Character:FindFirstChild("Right Leg"),
  345. Character:FindFirstChild("Left Leg")
  346. }
  347. if Joints[Limb] == nil then return false end
  348. if Limbs[Limb] == nil then return false end
  349. local Joint = Instance.new("Motor6D")
  350. Joint.Parent = Character.Torso
  351. Joint.Part0 = Character.Torso
  352. Joint.Part1 = Limbs[Limb]
  353. if Limb == 1 then
  354. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  355. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  356. Joint.Name = "Right Shoulder 2"
  357. elseif Limb == 2 then
  358. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  359. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  360. Joint.Name = "Left Shoulder 2"
  361. elseif Limb == 3 then
  362. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  363. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  364. Joint.Name = "Right Hip 2"
  365. elseif Limb == 4 then
  366. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  367. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  368. Joint.Name = "Left Hip 2"
  369. end
  370. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  371. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  372. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  373. Joints[Limb]:Remove()
  374. end
  375.  
  376.  
  377. function ResetLimbCFrame(Limb, Character)
  378. if Character == nil then return false end
  379. if Character.Parent == nil then return false end
  380. if Character:FindFirstChild("Torso") == nil then return false end
  381. local Joints = {
  382. Character.Torso:FindFirstChild("Right Shoulder 2"),
  383. Character.Torso:FindFirstChild("Left Shoulder 2"),
  384. Character.Torso:FindFirstChild("Right Hip 2"),
  385. Character.Torso:FindFirstChild("Left Hip 2")
  386. }
  387. local Limbs = {
  388. Character:FindFirstChild("Right Arm"),
  389. Character:FindFirstChild("Left Arm"),
  390. Character:FindFirstChild("Right Leg"),
  391. Character:FindFirstChild("Left Leg")
  392. }
  393. if Joints[Limb] == nil then return false end
  394. if Limbs[Limb] == nil then return false end
  395. if Limb == 1 then
  396. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  397. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  398. elseif Limb == 2 then
  399. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  400. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  401. elseif Limb == 3 then
  402. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  403. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  404. elseif Limb == 4 then
  405. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  406. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  407. end
  408. end
  409.  
  410.  
  411. function EnableLimb(Limb, Character)
  412. if Character == nil then return false end
  413. if Character:FindFirstChild("Torso") == nil then return false end
  414. local Joints = {
  415. Character.Torso:FindFirstChild("Right Shoulder 2"),
  416. Character.Torso:FindFirstChild("Left Shoulder 2"),
  417. Character.Torso:FindFirstChild("Right Hip 2"),
  418. Character.Torso:FindFirstChild("Left Hip 2")
  419. }
  420. local Limbs = {
  421. Character:FindFirstChild("Right Arm"),
  422. Character:FindFirstChild("Left Arm"),
  423. Character:FindFirstChild("Right Leg"),
  424. Character:FindFirstChild("Left Leg")
  425. }
  426. if Joints[Limb] == nil then return false end
  427. if Limbs[Limb] == nil then return false end
  428. if Limb == 1 then
  429. Joints[Limb].Name = "Right Shoulder"
  430. elseif Limb == 2 then
  431. Joints[Limb].Name = "Left Shoulder"
  432. elseif Limb == 3 then
  433. Joints[Limb].Name = "Right Hip"
  434. elseif Limb == 4 then
  435. Joints[Limb].Name = "Left Hip"
  436. end
  437. Animate = Character:FindFirstChild("Animate")
  438. if Animate == nil then return false end
  439. Animate = Animate:Clone()
  440. Character.Animate:Remove()
  441. Animate.Parent = Character
  442. end
  443.  
  444.  
  445. function onButton1Down(Mouse)
  446. if Button1Down == true then return end
  447. Button1Down = true
  448. if CheckPlayer() == false then return end
  449. if CanUse == true then
  450. CanUse = false
  451. DisableLimb(1, Player.Character)
  452. SetSpeed(1, 0.5, Player.Character)
  453. SetAngle(1, 0, Player.Character)
  454. RemoveParts(Player.Character, 1)
  455. CreateParts(Player.Character, 2)
  456. wait(0.2)
  457. for i = 0, 1, 0.075 do
  458. pcall(function()
  459. Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - (40 * i)), math.rad(-5 * i), math.rad(180 - (15 * i)))
  460. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5 - (0.15 * i), 0.5, -0.2 * i) * CFrame.fromEulerAnglesXYZ(math.rad(100 * i), math.rad(90 + (130 * i)), math.rad(40 * i))
  461. end)
  462. wait()
  463. end
  464. pcall(function()
  465. Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-130), math.rad(-5), math.rad(165))
  466. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.35, 0.5, -0.2) * CFrame.fromEulerAnglesXYZ(math.rad(100), math.rad(220), math.rad(40))
  467. end)
  468. wait(0.1)
  469. CanUse = true
  470. coroutine.wrap(function()
  471. while Selected == true and Button1Down == true do
  472. wait()
  473. end
  474. CanUse = false
  475. for i = 1, 0, -0.075 do
  476. pcall(function()
  477. Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - (40 * i)), math.rad(-5 * i), math.rad(180 - (15 * i)))
  478. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5 - (0.15 * i), 0.5, -0.2 * i) * CFrame.fromEulerAnglesXYZ(math.rad(100 * i), math.rad(90 + (130 * i)), math.rad(40 * i))
  479. end)
  480. wait()
  481. end
  482. pcall(function()
  483. Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(180))
  484. end)
  485. ResetLimbCFrame(1, Player.Character)
  486. EnableLimb(1, Player.Character)
  487. RemoveParts(Player.Character, 2)
  488. CreateParts(Player.Character, 1)
  489. CanUse = true
  490. end)()
  491. end
  492. end
  493.  
  494.  
  495. function onButton1Up(Mouse)
  496. Button1Down = false
  497. end
  498.  
  499.  
  500. function onKeyDown(Key, Mouse)
  501. if Selected == false then return end
  502. Key = Key:lower()
  503. if Button1Down == false and CanUse == true and CheckPlayer() == true then
  504. if Key == "q" then
  505. if Mouse.Target == nil then return end
  506. if CheckPlayer() == false then return end
  507. local NewPlayer = game:GetService("Players"):GetPlayerFromCharacter(Mouse.Target.Parent)
  508. if NewPlayer == nil then return end
  509. if NewPlayer.Character == nil then return end
  510. if NewPlayer.Character:FindFirstChild("Torso") == nil then return end
  511. if (NewPlayer.Character.Torso.Position - Player.Character.Torso.Position).magnitude > 10 then return end
  512. onDeselected(Mouse)
  513. wait()
  514. RemoveParts(Player.Character, 1)
  515. script.Parent.Parent = NewPlayer.Backpack
  516. Player = NewPlayer
  517. end
  518. end
  519. end
  520.  
  521.  
  522. function onSelected(Mouse)
  523. if Selected == true or CanUse == false then return end
  524. CanUse = false
  525. while true do
  526. if CheckPlayer() == true then
  527. if Player.Character.Torso:FindFirstChild("Right Shoulder") ~= nil then
  528. break
  529. end
  530. end
  531. wait(0.1)
  532. end
  533. Selected = true
  534. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  535. Mouse.Button1Down:connect(function() onButton1Down(Mouse) end)
  536. Mouse.Button1Up:connect(function() onButton1Up(Mouse) end)
  537. Mouse.KeyDown:connect(function(Key) onKeyDown(Key, Mouse) end)
  538. CanUse = true
  539. end
  540.  
  541.  
  542. function onDeselected(Mouse)
  543. if Selected == false then return end
  544. Selected = false
  545. end
  546.  
  547.  
  548. if script.Parent.ClassName ~= "HopperBin" then
  549. if Player == nil then print("Error: Player not found!") return end
  550. Tool = Instance.new("HopperBin")
  551. Tool.Name = ModelName
  552. Tool.Parent = Player.Backpack
  553. script.Name = "Main"
  554. script.Parent = Tool
  555. elseif script.Parent.ClassName == "HopperBin" and Connected == false then
  556. Connected = true
  557. Player = script.Parent.Parent.Parent
  558. end wait() if script.Parent.ClassName == "HopperBin" then
  559. while script.Parent.Parent.ClassName ~= "Backpack" do
  560. wait()
  561. end
  562. script.Parent.Selected:connect(onSelected)
  563. script.Parent.Deselected:connect(onDeselected)
  564. CreateParts(Player.Character, 1)
  565.  
  566. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement