Advertisement
memberhero

Untitled

Jul 9th, 2016
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.56 KB | None | 0 0
  1. name = "memberhero"
  2.  
  3. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  4. part.Parent = parent
  5. part.formFactor = form
  6. part.CanCollide = collide
  7. part.Transparency = tran
  8. part.Reflectance = ref
  9. part.Size = Vector3.new(x,y,z)
  10. part.BrickColor = BrickColor.new(color)
  11. part.TopSurface = 0
  12. part.BottomSurface = 0
  13. part.Anchored = anchor
  14. part.Locked = true
  15. part:BreakJoints()
  16. end
  17.  
  18. function weld(w, p, p1, a, b, c, x, y, z)
  19. w.Parent = p
  20. w.Part0 = p
  21. w.Part1 = p1
  22. w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
  23. end
  24.  
  25. function givegui(gui, part)
  26. local sc = Instance.new("ScreenGui")
  27. sc.Name = "GiveItem"
  28. local Mainframe = Instance.new("Frame",sc)
  29. Mainframe.Size = UDim2.new(0, 300, 0, 120)
  30. Mainframe.Position = UDim2.new(1, -301, 0.5, -60)
  31. Mainframe.BackgroundColor3 = Color3.new(0.6, 0.4, 0.2)
  32. Mainframe.BorderColor3 = Color3.new(1,0.8,0.1)
  33. local Txt = Instance.new("TextLabel",Mainframe)
  34. Txt.Position = UDim2.new(0.5,0,0,4)
  35. Txt.FontSize = "Size14"
  36. Txt.Text = "Take item: "..part.Name.." ?"
  37. Txt.TextColor3 = Color3.new(0.2,0,0)
  38. Txt.TextYAlignment = "Top"
  39. local buttons = {{"Yes", true, {0.2, 1, 0.2}}, {"No", false, {0.9, 0.2, 0.2}}}
  40. local x = 0.02
  41. for i,v in pairs(buttons) do
  42. local Button = Instance.new("TextButton")
  43. Button.Text = v[1]
  44. Button.FontSize = "Size14"
  45. Button.TextColor3 = Color3.new(0,0,0)
  46. Button.BackgroundColor3 = Color3.new(v[3][1], v[3][2], v[3][3])
  47. Button.Position = UDim2.new(x,0,0.58,0)
  48. Button.Size = UDim2.new(0.46, 0, 0.4, 0)
  49. Button.Parent = Mainframe
  50. Button.MouseButton1Click:connect(function()
  51. if v[2] then
  52. part.Parent = gui.Parent.Inventory
  53. end
  54. sc:remove()
  55. end)
  56. x = x + 0.5
  57. end
  58. sc.Parent = gui
  59. end
  60.  
  61. delitem = nil
  62.  
  63. function equipitem(part, char, rw, lw)
  64. local nam = part.Name
  65. local tool = Instance.new("Tool")
  66. tool.Name = nam
  67. part.Parent = tool
  68. part.Name = "Handle"
  69. tool.Parent = char
  70. tool.Changed:connect(function(p)
  71. if p == "Parent" then
  72. if tool.Parent ~= char and tool.Parent ~= game.Players:GetPlayerFromCharacter(char).Backpack then
  73. wait()
  74. part.Parent = workspace
  75. part.Name = nam
  76. tool:remove()
  77. end
  78. end
  79. end)
  80. tool.Equipped:connect(function(mouse)
  81. tool.Activated:connect(function()
  82. local rs = char.Torso["Right Shoulder"]
  83. local c = rs.C0
  84. for i = 0, 150, 150/6 do
  85. rs.C0 = c * CFrame.Angles(0,0,math.rad(i))
  86. wait()
  87. end
  88. for i = 150, 0, -150/3 do
  89. rs.C0 = c * CFrame.Angles(0,0,math.rad(i))
  90. wait()
  91. end
  92. part.Parent = workspace
  93. part.Name = nam
  94. part.CFrame = rs.Parent.CFrame * CFrame.new(0,0,-2)
  95. part.Velocity = rs.Parent.CFrame.lookVector * 140
  96. wait(0.2)
  97. tool.Parent = nil
  98. end)
  99. end)
  100. end
  101.  
  102. function additem(plr, gui, x, y, obj)
  103. local ob = obj
  104. local fr = Instance.new("Frame")
  105. fr.Size = UDim2.new(0.14, 0, 0.14, 0)
  106. fr.Position = UDim2.new(x+0.02, 0, y+0.02, 0)
  107. fr.BackgroundColor3 = Color3.new(0.1, 0.07, 0.04)
  108. local but = Instance.new("TextButton",fr)
  109. but.Size = UDim2.new(0.9,0,0.9,0)
  110. but.Position = UDim2.new(0.05, 0, 0.05, 0)
  111. but.BackgroundColor3 = Color3.new(0.2, 0.3, 0.6)
  112. but.Text = ob.Name
  113. but.TextColor3 = Color3.new(0, 0, 0)
  114. but.TextYAlignment = "Top"
  115. but.MouseButton1Click:connect(function()
  116. equipitem(ob, plr.Character)
  117. end)
  118. fr.Parent = gui
  119. end
  120.  
  121. delitem = function(plr, gui, obj, stuff)
  122. local x = 0
  123. local y = 0
  124. for i,v in pairs(gui:children()) do
  125. v:remove()
  126. end
  127. for i,v in pairs(stuff:children()) do
  128. if x < 0.8 then
  129. additem(plr, gui, x, y, v)
  130. y = y + 0.15
  131. if y >= 0.8 then
  132. y = 0
  133. x = x + 0.15
  134. end
  135. end
  136. end
  137. return x, y
  138. end
  139.  
  140. function invgui(plr, gui, stuff)
  141. local sc = Instance.new("ScreenGui")
  142. sc.Name = "Inv"
  143. local inv = Instance.new("TextButton")
  144. inv.BackgroundColor3 = Color3.new(0.5, 0.35, 0.25)
  145. inv.FontSize = "Size14"
  146. inv.TextWrap = true
  147. inv.Text = "Inventory"
  148. inv.Font = "ArialBold"
  149. inv.Size = UDim2.new(0,70,0,50)
  150. inv.Position = UDim2.new(0.5,-35,1,-50)
  151. inv.TextYAlignment = "Top"
  152. inv.Parent = sc
  153. local invframe = Instance.new("Frame",sc)
  154. invframe.Visible = false
  155. invframe.Size = UDim2.new(0,400,0,320)
  156. invframe.Position = UDim2.new(0.5, -200, 0.5, -160)
  157. invframe.BackgroundColor3 = Color3.new(0.6, 0.4, 0.15)
  158. inv.MouseButton1Click:connect(function()
  159. if invframe.Visible then
  160. invframe.Visible = false
  161. else
  162. invframe.Visible = true
  163. end
  164. end)
  165. local x = 0
  166. local y = 0
  167. stuff.ChildAdded:connect(function(obj)
  168. if x < 0.8 then
  169. additem(plr, invframe, x, y, obj)
  170. y = y + 0.15
  171. if y >= 0.8 then
  172. y = 0
  173. x = x + 0.15
  174. end
  175. end
  176. end)
  177. stuff.ChildRemoved:connect(function(obj)
  178. x, y = delitem(plr, invframe, obj, stuff)
  179. end)
  180. sc.Parent = gui
  181. end
  182.  
  183. function givestats(plr)
  184. if plr:findFirstChild("Inventory") ~= nil then plr.Inventory:remove() end
  185. local stuff = Instance.new("IntValue")
  186. stuff.Name = "Inventory"
  187. stuff.Value = 0
  188. stuff.Parent = plr
  189. end
  190.  
  191. function backpack(plr)
  192. repeat wait() until plr.Character
  193. local char = plr.Character
  194. if char then
  195. local gui, torso, head = plr:findFirstChild("PlayerGui"), char:findFirstChild("Torso"), char:findFirstChild("Head")
  196. if gui and torso and head then
  197. for i,v in pairs(char:children()) do
  198. if v.Name == name then v:remove() end
  199. end
  200. for i,v in pairs(gui:children()) do
  201. if v.Name == "Inv" or v.Name == "GiveItem" then v:remove() end
  202. end
  203. invgui(plr, gui, plr.Inventory)
  204. local back = Instance.new("Model")
  205. back.Name = name
  206. local floo = Instance.new("Part")
  207. prop(floo, back, false, 0, 0, 2.05, 0.2, 1.1, "Reddish brown", false, "Custom")
  208. local w1 = Instance.new("Weld")
  209. weld(w1, torso, floo, 0, 0, 0, 0, 1.1, -1.05)
  210. local main = Instance.new("Part")
  211. prop(main, back, false, 0, 0, 2.05, 2.28, 0.2, "Reddish brown", false, "Custom")
  212. local w6 = Instance.new("Weld")
  213. weld(w6, torso, main, 0, 0, 0, 0, 0.07, -0.55)
  214. for i=-50,30,20 do
  215. local p = Instance.new("Part")
  216. prop(p, back, false, 0, 0, 2.25, 0.6, 0.2, "Brown", false, "Custom")
  217. local w2 = Instance.new("Weld")
  218. w2.C0 = CFrame.new(0,-0.1,0.5) * CFrame.Angles(math.rad(i),0,0)
  219. weld(w2, torso, p, 0, 0, 0, 0, 0, -1.3)
  220. for x = -1.025, 1.025, 2.05 do
  221. local p2 = Instance.new("Part")
  222. prop(p2, back, false, 0, 0, 0.2, 0.8, 0.8, "Brown", false, "Custom")
  223. local w3 = Instance.new("Weld")
  224. weld(w3, p, p2, 0, 0, 0, x, 0, 0.4)
  225. end
  226. end
  227. for i = -1.025, 1.025, 2.05 do
  228. local side = Instance.new("Part")
  229. prop(side, back, false, 0, 0, 0.2, 2.2, 0.9, "Brown", false, "Custom")
  230. local w4 = Instance.new("Weld")
  231. weld(w4, torso, side, 0, 0, 0, i, 0, -0.95)
  232. end
  233. local last = nil
  234. for i = -130, -10, 15 do
  235. local bla = Instance.new("Part")
  236. prop(bla, back, false, 0, 0, 2.05, 0.4, 0.2, "Reddish brown", false, "Custom")
  237. local w5 = Instance.new("Weld")
  238. w5.C0 = CFrame.new(0,0.33,0.48) * CFrame.Angles(math.rad(i),0,0)
  239. weld(w5, main, bla, 0, 0, 0, 0, 0, -1)
  240. last = bla
  241. end
  242. local yel = Instance.new("Part")
  243. prop(yel, back, false, 0, 0, 0.5, 0.3, 0.2, "Bright yellow", false, "Custom")
  244. local w7 = Instance.new("Weld")
  245. weld(w7, last, yel, 0, 0, 0, 0, 0, -0.05)
  246. for i = -1.1, 1.1, 2.2 do
  247. local pock = Instance.new("Part")
  248. prop(pock, back, false, 0, 0, 0.4, 0.6, 0.8, "Reddish brown", false, "Custom")
  249. local w8 = Instance.new("Weld")
  250. weld(w8, main, pock, 0, 0, 0, i, 0.4, -0.6)
  251.  
  252. local ye = Instance.new("Part")
  253. prop(ye, back, false, 0, 0, 0.45, 0.2, 0.35, "Bright yellow", false, "Custom")
  254. local w9 = Instance.new("Weld")
  255. weld(w9, pock, ye, 0, 0, 0, 0, -0.15, 0)
  256.  
  257. for x = -1, 1, 2 do
  258. local lul = Instance.new("Part")
  259. prop(lul, back, false, 0, 0, 0.5, 0.2, 1.08, "Reddish brown", false, "Custom")
  260. local w11 = Instance.new("Weld")
  261. weld(w11, torso, lul, 0, 0, 0, i/1.3, x, 0)
  262. end
  263.  
  264. for x = -30, 30, 5 do
  265. local ho = Instance.new("Part")
  266. prop(ho, back, false, 0, 0, 0.5, 0.32, 0.2, "Reddish brown", false, "Custom")
  267. local w10 = Instance.new("Weld")
  268. w10.C0 = CFrame.new(i/1.3, 0.1, 0.65) * CFrame.Angles(math.rad(x),0,0)
  269. weld(w10, main, ho, 0, 0, 0, 0, 0, 1.85)
  270. end
  271. end
  272.  
  273. local rb = Instance.new("Part")
  274. prop( rb, back, false, 1, 0, 0.1, 0.1, 0.1, "Bright red", false, "Custom" )
  275. local rh = Instance.new("Weld")
  276. weld( rh, torso, rb, 0, 0, 0, -1.5, -0.5, 0)
  277.  
  278. local lb = Instance.new("Part")
  279. prop( lb, back, false, 1, 0, 0.1, 0.1, 0.1, "Bright red", false, "Custom" )
  280. local lh = Instance.new("Weld")
  281. weld( lh, torso, lb, 0, 0, 0, 1.5, -0.5, 0)
  282.  
  283. local rw = Instance.new("Weld")
  284. weld(rw,rb,nil,0,0,0,0,0.5,0)
  285.  
  286. local lw = Instance.new("Weld")
  287. weld(lw,lb,nil,0,0,0,0,0.5,0)
  288.  
  289. back.Parent = char
  290. for i,v in pairs(char:children()) do
  291. if v:IsA("BasePart") then
  292. v.Touched:connect(function(hit)
  293. if hit:GetMass() <= 5 and hit.Parent.className ~= "Hat" and hit.CanCollide and hit.Parent.className ~= "Tool" and hit.Anchored == false and hit.Parent:findFirstChild("Humanoid") == nil and gui:findFirstChild("GiveItem") == nil then
  294. givegui(gui, hit)
  295. end
  296. end)
  297. end
  298. end
  299. end
  300. end
  301. end
  302.  
  303. for i,v in pairs(game.Players:GetPlayers()) do
  304. givestats(v)
  305. coroutine.resume(coroutine.create(function()
  306. backpack(v)
  307. end))
  308. v.CharacterAdded:connect(function() backpack(v) end)
  309. end
  310.  
  311. game.Players.PlayerAdded:connect(function(p)
  312. givestats(p)
  313. coroutine.resume(coroutine.create(function()
  314. backpack(p)
  315. end))
  316. wait(1)
  317. p.CharacterAdded:connect(function() backpack(p) end)
  318. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement