Advertisement
sIendytubble

Steve Script Villager Edition

Apr 10th, 2020
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 98.02 KB | None | 0 0
  1. --[[
  2. Hey, thanks for using my Steve script!
  3. (WOOHOO! Void Script Builder Compatible!!)
  4. updateBoard V1.0.0
  5. ChangeLogs:
  6. 4/10/2020:
  7. Added Alex Skin(its a equal chance to be either steve or alex)
  8. Gravity to sand and gravel
  9. creative inventory(press R)
  10. (since i gave you controls to the creative inventory *sigh*-
  11. i guess ill give you the rest of them)
  12. CONTROLS:
  13. press w 2 times for sprint
  14. press b to build a block
  15. press e to change block in the toolbar
  16. click a block in the creative inventory or in the toolbar-
  17. to put a block back or get one out-
  18. -(you dont have to hold it you only have to click twice.one-
  19. to pick second to put)
  20. press q to crouch
  21. 4/9/2020:
  22. HUGE UPDATE!!
  23. added features place blocks,some of the features from https://pastebin.com/raw/2NNDTLjL version,
  24. heart bar
  25. changes to the inventory slot
  26. new death message "Player1 fell from a high place"
  27. fall damage
  28. little bit of low gravity so the jumping is useful for parkour.
  29. 4/8/2020:
  30. added NameTag
  31. Block Outlines
  32. Particles on break
  33. Block Cracks
  34. Join Message,Death Message
  35. Changed Chat Message/Notification Size
  36. Special Note:
  37. im letting people become a beta tester to some of my new features for FREE!
  38. dm on discord at Boeing 767#8836 if you want to test some new features.
  39. Beta Testers:
  40. guest712921
  41. --]]
  42. --https://github.com/Mokiros/roblox-FE-compatibility
  43. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  44. local Player,game,owner = owner,game
  45. local RealPlayer = Player
  46. do
  47. print("FE Compatibility code V2 by Mokiros")
  48. local RealPlayer = RealPlayer
  49. script.Parent = RealPlayer.Character
  50.  
  51. --Fake event to make stuff like Mouse.KeyDown work
  52. local Disconnect_Function = function(this)
  53. this[1].Functions[this[2]] = nil
  54. end
  55. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  56. local FakeEvent_Metatable = {__index={
  57. Connect = function(this,f)
  58. local i = tostring(math.random(0,10000))
  59. while this.Functions[i] do
  60. i = tostring(math.random(0,10000))
  61. end
  62. this.Functions[i] = f
  63. return setmetatable({this,i},Disconnect_Metatable)
  64. end
  65. }}
  66. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  67. local function fakeEvent()
  68. return setmetatable({Functions={}},FakeEvent_Metatable)
  69. end
  70.  
  71. --Creating fake input objects with fake variables
  72. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  73. FakeMouse.keyUp = FakeMouse.KeyUp
  74. FakeMouse.keyDown = FakeMouse.KeyDown
  75. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  76. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  77. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  78. end}
  79. --Merged 2 functions into one by checking amount of arguments
  80. CAS.UnbindAction = CAS.BindAction
  81.  
  82. --This function will trigger the events that have been :Connect()'ed
  83. local function TriggerEvent(self,ev,...)
  84. for _,f in pairs(self[ev].Functions) do
  85. f(...)
  86. end
  87. end
  88. FakeMouse.TriggerEvent = TriggerEvent
  89. UIS.TriggerEvent = TriggerEvent
  90.  
  91. --Client communication
  92. local Event = Instance.new("RemoteEvent")
  93. Event.Name = "UserInput_Event"
  94. Event.OnServerEvent:Connect(function(plr,io)
  95. if plr~=RealPlayer then return end
  96. FakeMouse.Target = io.Target
  97. FakeMouse.Hit = io.Hit
  98. if not io.isMouse then
  99. local b = io.UserInputState == Enum.UserInputState.Begin
  100. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  101. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  102. end
  103. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  104. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  105. end
  106. for _,t in pairs(CAS.Actions) do
  107. for _,k in pairs(t.Keys) do
  108. if k==io.KeyCode then
  109. t.Function(t.Name,io.UserInputState,io)
  110. end
  111. end
  112. end
  113. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  114. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  115. end
  116. end)
  117. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  118. local Mouse = owner:GetMouse()
  119. local UIS = game:GetService("UserInputService")
  120. local input = function(io,RobloxHandled)
  121. if RobloxHandled then return end
  122. --Since InputObject is a client-side instance, we create and pass table instead
  123. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  124. end
  125. UIS.InputBegan:Connect(input)
  126. UIS.InputEnded:Connect(input)
  127.  
  128. local h,t
  129. --Give the server mouse data every second frame, but only if the values changed
  130. --If player is not moving their mouse, client won't fire events
  131. local HB = game:GetService("RunService").Heartbeat
  132. while true do
  133. if h~=Mouse.Hit or t~=Mouse.Target then
  134. h,t=Mouse.Hit,Mouse.Target
  135. Event:FireServer({isMouse=true,Target=t,Hit=h})
  136. end
  137. --Wait 2 frames
  138. for i=1,2 do
  139. HB:Wait()
  140. end
  141. end]==],script)
  142.  
  143. ----Sandboxed game object that allows the usage of client-side methods and services
  144. --Real game object
  145. local RealGame = game
  146.  
  147. --Metatable for fake service
  148. local FakeService_Metatable = {
  149. __index = function(self,k)
  150. local s = rawget(self,"_RealService")
  151. if s then
  152. return typeof(s[k])=="function"
  153. and function(_,...)return s[k](s,...)end or s[k]
  154. end
  155. end,
  156. __newindex = function(self,k,v)
  157. local s = rawget(self,"_RealService")
  158. if s then s[k]=v end
  159. end
  160. }
  161. local function FakeService(t,RealService)
  162. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  163. return setmetatable(t,FakeService_Metatable)
  164. end
  165.  
  166. --Fake game object
  167. local FakeGame = {
  168. GetService = function(self,s)
  169. return rawget(self,s) or RealGame:GetService(s)
  170. end,
  171. Players = FakeService({
  172. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  173. },"Players"),
  174. UserInputService = FakeService(UIS,"UserInputService"),
  175. ContextActionService = FakeService(CAS,"ContextActionService"),
  176. RunService = FakeService({
  177. _btrs = {},
  178. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  179. BindToRenderStep = function(self,name,_,fun)
  180. self._btrs[name] = self.Heartbeat:Connect(fun)
  181. end,
  182. UnbindFromRenderStep = function(self,name)
  183. self._btrs[name]:Disconnect()
  184. end,
  185. },"RunService")
  186. }
  187. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  188. FakeGame.service = FakeGame.GetService
  189. FakeService(FakeGame,game)
  190. --Changing owner to fake player object to support owner:GetMouse()
  191. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  192. end
  193.  
  194. -- ORIGINAL CREATOR: Depr1
  195. --Fixed lags by stommmDev for toasters if the creator wants to shut down this script i will
  196. -- If this script isn't on pastebin or the user who uploaded this isn't called "Delros12"
  197. -- (and yes my pastebin account is Delros12) or the link is not https://pastebin.com/2NNDTLjL
  198. -- then this is not the original link of this script.
  199.  
  200. -- The original link of the script gets edited constantly for updates, if you use the original
  201. -- link you will be able to enjoy the most recent updates of this script without changing to
  202. -- another link which contains updated script.
  203.  
  204. -- Enjoy! :)
  205. -- Controls: Q to sneak, use the keypad numbers 1-9 to change blocks, choose a empty slot i
  206. -- you want to remove a block.
  207. faces = {"http://www.roblox.com/asset/?id=111288035"}
  208. local Changelog = [[
  209.  
  210. Hey, thanks for using my Steve script!
  211. (WOOHOO! Void Script Builder Compatible!!)
  212. updateBoard V1.0.0
  213. ChangeLogs:
  214. 4/10/2020:
  215. Added Alex Skin(its a equal chance to be either steve or alex)
  216. Gravity to sand and gravel
  217. creative inventory(press R)
  218. (since i gave you controls to the creative inventory *sigh*-
  219. i guess ill give you the rest of them)
  220. CONTROLS:
  221. press w 2 times for sprint
  222. press b to build a block
  223. press e to change block in the toolbar
  224. click a block in the creative inventory or in the toolbar-
  225. to put a block back or get one out-
  226. -(you dont have to hold it you only have to click twice.one-
  227. to pick second to put)
  228. press q to crouch
  229. 4/9/2020:
  230. HUGE UPDATE!!
  231. added features place blocks,some of the features from https://pastebin.com/raw/2NNDTLjL version,
  232. heart bar
  233. changes to the inventory slot
  234. new death message "Player1 fell from a high place"
  235. fall damage
  236. little bit of low gravity so the jumping is useful for parkour.
  237. 4/8/2020:
  238. added NameTag
  239. Block Outlines
  240. Particles on break
  241. Block Cracks
  242. Join Message,Death Message
  243. Changed Chat Message/Notification Size
  244. Special Note:
  245. im letting people become a beta tester to some of my new features for FREE!
  246. dm on discord at Boeing 767#8836 if you want to test some new features.
  247. Beta Testers:
  248. guest712921
  249. ]]
  250. -- this script will transform you into steve when used
  251. function getSideByLocation(loc)
  252. local side = nil
  253. if loc.X < 0 then side = "Left" end
  254. if loc.X > 0 then side = "Right" end
  255. if loc.Y > 0 then side = "Top" end
  256. if loc.Y < 0 then side = "Bottom" end
  257. if loc.Z < 0 then side = "Front" end
  258. if loc.Z > 0 then side = "Back" end
  259.  
  260. if (math.abs(loc.X) > 0 and math.abs(loc.Y) > 0) or
  261. (math.abs(loc.X) > 0 and math.abs(loc.Z) > 0) or
  262. (math.abs(loc.Y) > 0 and math.abs(loc.Z) > 0)
  263. then
  264. return nil
  265. end
  266. return side
  267. end
  268. workspace:WaitForChild("Camera"):ClearAllChildren()
  269. local RS = game:GetService("RunService").RenderStepped
  270. local targetName = game.Players.LocalPlayer.Name
  271. local player = game.Players.LocalPlayer
  272. function putTexture(part, frontF, backF, topF, bottomF, leftF, rightF, className)
  273. local faces = {"Front", "Back", "Top", "Bottom", "Left", "Right"}
  274. for i,f in pairs(faces) do
  275. local decal = Instance.new(className, part)
  276. if i == 1 then decal.Texture = frontF decal.Name = f end
  277. if i == 2 then decal.Texture = backF or frontF decal.Name = f end
  278. if i == 3 then decal.Texture = topF or frontF decal.Name = f end
  279. if i == 4 then decal.Texture = bottomF or frontF decal.Name = f end
  280. if i == 5 then decal.Texture = leftF or frontF decal.Name = f end
  281. if i == 6 then decal.Texture = rightF or frontF decal.Name = f end
  282. decal.Face = f
  283. end
  284. return part
  285. end
  286. function makeSquare(position, size, color, transparency, parent, zindex)
  287. local label = Instance.new("TextLabel", parent)
  288. label.Text = ""
  289. label.BorderSizePixel = 0
  290. label.BackgroundTransparency = transparency
  291. label.Position = position
  292. label.Size = size
  293. label.BackgroundColor3 = color
  294. if zindex == nil then label.ZIndex = 1 else label.ZIndex = zindex end
  295. return label
  296. end
  297. function makeImage(position, size, image, parent, zindex)
  298. local imglabel = Instance.new("ImageLabel", parent)
  299. imglabel.BorderSizePixel = 0
  300. imglabel.BackgroundTransparency = 1
  301. imglabel.Position = position
  302. imglabel.Size = size
  303. imglabel.Image = image
  304. if zindex == nil then imglabel.ZIndex = 1 else imglabel.ZIndex = zindex end
  305. return imglabel
  306. end
  307. function putToolBarSlot(position, image, zindex)
  308. local playerGui = player:FindFirstChild("PlayerGui")
  309. if playerGui then
  310. local gui = playerGui:FindFirstChild("ToolBar") or Instance.new("ScreenGui", playerGui)
  311. gui.Name = "ToolBar"
  312. local slot = Instance.new("ImageLabel", gui)
  313. slot.Position = position
  314. slot.Size = UDim2.new(0, 32, 0, 32)
  315. slot.BackgroundTransparency = 1
  316. slot.ImageTransparency = 0
  317. slot.Image = image
  318. slot.ZIndex = 2
  319.  
  320. local imgSlot = makeImage(UDim2.new(0, 0, 0, 0), UDim2.new(0, 32, 0, 32),
  321. "rbxassetid://347007448", slot)
  322.  
  323. imgSlot.ImageTransparency = 0.25
  324. imgSlot.BackgroundTransparency = 1
  325. imgSlot.ImageColor3 = Color3.new(0.225, 0.225, 0.225)
  326.  
  327. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 2, 0, 32),
  328. Color3.new(0/255, 0/255, 0/255), 0.7, slot)
  329. makeSquare(UDim2.new(0, 2, 0, 0), UDim2.new(0, 30, 0, 2),
  330. Color3.new(0/255, 0/255, 0/255), 0.7, slot)
  331. makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 36, 0, 2),
  332. Color3.new(106/255, 106/255, 106/255), 0, slot)
  333. makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 2, 0, 36),
  334. Color3.new(106/255, 106/255, 106/255), 0, slot)
  335. makeSquare(UDim2.new(0, 0, 0, 32), UDim2.new(0, 34, 0, 2),
  336. Color3.new(130/255, 130/255, 130/255), 0, slot)
  337. makeSquare(UDim2.new(0, 32, 0, 0), UDim2.new(0, 2, 0, 34),
  338. Color3.new(130/255, 130/255, 130/255), 0, slot)
  339. makeSquare(UDim2.new(0, -4, 0, -2), UDim2.new(0, 2, 0, 38),
  340. Color3.new(130/255, 130/255, 130/255), 0, slot)
  341. makeSquare(UDim2.new(0, 34, 0, -2), UDim2.new(0, 2, 0, 36),
  342. Color3.new(106/255, 106/255, 106/255), 0, slot)
  343. makeSquare(UDim2.new(0, -2, 0, 34), UDim2.new(0, 38, 0, 2),
  344. Color3.new(106/255, 106/255, 106/255), 0, slot)
  345. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 40, 0, 2),
  346. Color3.new(156/255, 156/255, 156/255), 0, slot)
  347. return slot
  348. end
  349. end
  350. function divide(x, d)
  351. if x ~= 0 and d ~= 0 then
  352. return x/d
  353. else
  354. return x
  355. end
  356. end -- so it doesn't divide by zero
  357. function getDistance(v1, v2)
  358. return math.abs((Vector3.new(math.abs(v2.X - v1.X), math.abs(v2.Y - v1.Y), math.abs(v2.Z - v1.Z))).Magnitude)
  359. end
  360. function SnapToGrid(x, gridX)
  361. local x = math.floor((x / gridX) + 0.5) * gridX
  362. return x
  363. end
  364. function round(x)
  365. if x%2 ~= 0.5 then
  366. return math.floor(x+0.5)
  367. end
  368. return x-0.5
  369. end
  370. function weldTo(part1, part2)
  371. local weld = Instance.new("Weld", part1)
  372. weld.Part0 = part1
  373. weld.Part1 = part2
  374. end
  375. function getMagnitudeXZ(velocity)
  376. return math.abs(velocity.X) + math.abs(velocity.Z)
  377. end
  378. function getBlockAtRegion(region)
  379. local blockFound = nil
  380. for _,part in pairs(game.Workspace:FindPartsInRegion3(region, nil, math.huge)) do
  381. local usePart = true
  382. if part.Name == "Debris" then usePart = false end
  383. if usePart == true then
  384. blockFound = part
  385. break
  386. end
  387. end
  388. return blockFound
  389. end
  390. local RS = game:GetService("RunService").RenderStepped
  391. local creativeInventory = {
  392. {
  393. name = "Dirt",
  394. size = Vector3.new(2.6, 2.6, 2.6),
  395. transparency = 0;
  396. frontTex = "rbxassetid://152569532",
  397. backTex = "rbxassetid://152569532",
  398. topTex = "rbxassetid://152569532",
  399. bottomTex = "rbxassetid://152569532",
  400. leftTex = "rbxassetid://152569532",
  401. rightTex = "rbxassetid://152569532",
  402. displayTex = "",
  403. sound = "rbxassetid://1102186681",
  404. soundVol = 1.25,
  405. hasGravity = false,
  406. objectType = "Block"
  407. },
  408. {
  409. name = "Grass",
  410. size = Vector3.new(2.6, 2.6, 2.6),
  411. transparency = 0;
  412. frontTex = "rbxassetid://96430337",
  413. backTex = "rbxassetid://96430337",
  414. topTex = "rbxassetid://96430265",
  415. bottomTex = "rbxassetid://179655033",
  416. leftTex = "rbxassetid://96430337",
  417. rightTex = "rbxassetid://96430337",
  418. displayTex = "",
  419. sound = "rbxassetid://1102186681",
  420. soundVol = 1.25,
  421. hasGravity = false,
  422. objectType = "Block"
  423. },
  424. {
  425. name = "Sand",
  426. size = Vector3.new(2.6, 2.6, 2.6),
  427. transparency = 0;
  428. frontTex = "rbxassetid://347007448",
  429. backTex = "rbxassetid://347007448",
  430. topTex = "rbxassetid://347007448",
  431. bottomTex = "rbxassetid://347007448",
  432. leftTex = "rbxassetid://347007448",
  433. rightTex = "rbxassetid://347007448",
  434. displayTex = "",
  435. sound = "rbxassetid://1102186681",
  436. soundVol = 1.25,
  437. hasGravity = true,
  438. objectType = "Block"
  439. },
  440. {
  441. name = "Gravel",
  442. size = Vector3.new(2.6, 2.6, 2.6),
  443. transparency = 0;
  444. frontTex = "rbxassetid://151701568",
  445. backTex = "rbxassetid://151701568",
  446. topTex = "rbxassetid://151701568",
  447. bottomTex = "rbxassetid://151701568",
  448. leftTex = "rbxassetid://151701568",
  449. rightTex = "rbxassetid://151701568",
  450. displayTex = "",
  451. sound = "rbxassetid://1102186681",
  452. soundVol = 1.25,
  453. hasGravity = true,
  454. objectType = "Block"
  455. },
  456. {
  457. name = "Stone",
  458. size = Vector3.new(2.6, 2.6, 2.6),
  459. transparency = 0;
  460. frontTex = "rbxassetid://75880927",
  461. backTex = "rbxassetid://75880927",
  462. topTex = "rbxassetid://75880927",
  463. bottomTex = "rbxassetid://75880927",
  464. leftTex = "rbxassetid://75880927",
  465. rightTex = "rbxassetid://75880927",
  466. displayTex = "",
  467. sound = "rbxassetid://1016978163",
  468. soundVol = 2,
  469. hasGravity = false,
  470. objectType = "Block"
  471. },
  472. {
  473. name = "Diamond Ore",
  474. size = Vector3.new(2.6, 2.6, 2.6),
  475. transparency = 0;
  476. frontTex = "rbxassetid://57928490",
  477. backTex = "rbxassetid://57928490",
  478. topTex = "rbxassetid://57928490",
  479. bottomTex = "rbxassetid://57928490",
  480. leftTex = "rbxassetid://57928490",
  481. rightTex = "rbxassetid://57928490",
  482. displayTex = "",
  483. sound = "rbxassetid://1016978163",
  484. soundVol = 2,
  485. hasGravity = false,
  486. objectType = "Block"
  487. },
  488. {
  489. name = "Diamond Block",
  490. size = Vector3.new(2.6, 2.6, 2.6),
  491. transparency = 0;
  492. frontTex = "rbxassetid://56749955",
  493. backTex = "rbxassetid://56749955",
  494. topTex = "rbxassetid://56749955",
  495. bottomTex = "rbxassetid://56749955",
  496. leftTex = "rbxassetid://56749955",
  497. rightTex = "rbxassetid://56749955",
  498. displayTex = "",
  499. sound = "rbxassetid://1016978163",
  500. soundVol = 2,
  501. hasGravity = false,
  502. objectType = "Block"
  503. },
  504. {
  505. name = "Emerald Block",
  506. size = Vector3.new(2.6, 2.6, 2.6),
  507. transparency = 0;
  508. frontTex = "rbxassetid://152410853",
  509. backTex = "rbxassetid://152410853",
  510. topTex = "rbxassetid://152410853",
  511. bottomTex = "rbxassetid://152410853",
  512. leftTex = "rbxassetid://152410853",
  513. rightTex = "rbxassetid://152410853",
  514. displayTex = "",
  515. sound = "rbxassetid://1016978163",
  516. soundVol = 2,
  517. hasGravity = false,
  518. objectType = "Block"
  519. },
  520. {
  521. name = "Emerald Ore",
  522. size = Vector3.new(2.6, 2.6, 2.6),
  523. transparency = 0;
  524. frontTex = "rbxassetid://152410868",
  525. backTex = "rbxassetid://152410868",
  526. topTex = "rbxassetid://152410868",
  527. bottomTex = "rbxassetid://152410868",
  528. leftTex = "rbxassetid://152410868",
  529. rightTex = "rbxassetid://152410868",
  530. displayTex = "",
  531. sound = "rbxassetid://1016978163",
  532. soundVol = 2,
  533. hasGravity = false,
  534. objectType = "Block"
  535. },
  536. {
  537. name = "Obsidian",
  538. size = Vector3.new(2.6, 2.6, 2.6),
  539. transparency = 0;
  540. frontTex = "rbxassetid://112560322",
  541. backTex = "rbxassetid://112560322",
  542. topTex = "rbxassetid://112560322",
  543. bottomTex = "rbxassetid://112560322",
  544. leftTex = "rbxassetid://112560322",
  545. rightTex = "rbxassetid://112560322",
  546. displayTex = "",
  547. sound = "rbxassetid://1016978163",
  548. soundVol = 2,
  549. hasGravity = false,
  550. objectType = "Block"
  551. },
  552. {
  553. name = "Gold Block",
  554. size = Vector3.new(2.6, 2.6, 2.6),
  555. transparency = 0;
  556. frontTex = "rbxassetid://152572128",
  557. backTex = "rbxassetid://152572128",
  558. topTex = "rbxassetid://152572128",
  559. bottomTex = "rbxassetid://152572128",
  560. leftTex = "rbxassetid://152572128",
  561. rightTex = "rbxassetid://152572128",
  562. displayTex = "",
  563. sound = "rbxassetid://1016978163",
  564. soundVol = 2,
  565. hasGravity = false,
  566. objectType = "Block"
  567. },
  568. {
  569. name = "Gold Ore",
  570. size = Vector3.new(2.6, 2.6, 2.6),
  571. transparency = 0;
  572. frontTex = "rbxassetid://152572121",
  573. backTex = "rbxassetid://152572121",
  574. topTex = "rbxassetid://152572121",
  575. bottomTex = "rbxassetid://152572121",
  576. leftTex = "rbxassetid://152572121",
  577. rightTex = "rbxassetid://152572121",
  578. displayTex = "",
  579. sound = "rbxassetid://1016978163",
  580. soundVol = 2,
  581. hasGravity = false,
  582. objectType = "Block"
  583. },
  584. {
  585. name = "Iron Block",
  586. size = Vector3.new(2.6, 2.6, 2.6),
  587. transparency = 0;
  588. frontTex = "rbxassetid://152572134",
  589. backTex = "rbxassetid://152572134",
  590. topTex = "rbxassetid://152572134",
  591. bottomTex = "rbxassetid://152572134",
  592. leftTex = "rbxassetid://152572134",
  593. rightTex = "rbxassetid://152572134",
  594. displayTex = "",
  595. sound = "rbxassetid://1016978163",
  596. soundVol = 2,
  597. hasGravity = false,
  598. objectType = "Block"
  599. },
  600. {
  601. name = "Iron Ore",
  602. size = Vector3.new(2.6, 2.6, 2.6),
  603. transparency = 0;
  604. frontTex = "rbxassetid://132879562",
  605. backTex = "rbxassetid://132879562",
  606. topTex = "rbxassetid://132879562",
  607. bottomTex = "rbxassetid://132879562",
  608. leftTex = "rbxassetid://132879562",
  609. rightTex = "rbxassetid://132879562",
  610. displayTex = "",
  611. sound = "rbxassetid://1016978163",
  612. soundVol = 2,
  613. hasGravity = false,
  614. objectType = "Block"
  615. },
  616. {
  617. name = "Redstone Block",
  618. size = Vector3.new(2.6, 2.6, 2.6),
  619. transparency = 0;
  620. frontTex = "rbxassetid://136260219",
  621. backTex = "rbxassetid://136260219",
  622. topTex = "rbxassetid://136260219",
  623. bottomTex = "rbxassetid://136260219",
  624. leftTex = "rbxassetid://136260219",
  625. rightTex = "rbxassetid://136260219",
  626. sound = "rbxassetid://1016978163",
  627. soundVol = 2,
  628. hasGravity = false,
  629. objectType = "Block"
  630. },
  631. {
  632. name = "Redstone Ore",
  633. size = Vector3.new(2.6, 2.6, 2.6),
  634. transparency = 0;
  635. frontTex = "rbxassetid://152572209",
  636. backTex = "rbxassetid://152572209",
  637. topTex = "rbxassetid://152572209",
  638. bottomTex = "rbxassetid://152572209",
  639. leftTex = "rbxassetid://152572209",
  640. rightTex = "rbxassetid://152572209",
  641. displayTex = "",
  642. sound = "rbxassetid://1016978163",
  643. soundVol = 2,
  644. hasGravity = false,
  645. objectType = "Block"
  646. },
  647. {
  648. name = "Coal Block",
  649. size = Vector3.new(2.6, 2.6, 2.6),
  650. transparency = 0;
  651. frontTex = "rbxassetid://152527418",
  652. backTex = "rbxassetid://152527418",
  653. topTex = "rbxassetid://152527418",
  654. bottomTex = "rbxassetid://152527418",
  655. leftTex = "rbxassetid://152527418",
  656. rightTex = "rbxassetid://152527418",
  657. displayTex = "",
  658. sound = "rbxassetid://1016978163",
  659. soundVol = 2,
  660. hasGravity = false,
  661. objectType = "Block"
  662. },
  663. {
  664. name = "Coal Ore",
  665. size = Vector3.new(2.6, 2.6, 2.6),
  666. transparency = 0;
  667. frontTex = "rbxassetid://152572101",
  668. backTex = "rbxassetid://152572101",
  669. topTex = "rbxassetid://152572101",
  670. bottomTex = "rbxassetid://152572101",
  671. leftTex = "rbxassetid://152572101",
  672. rightTex = "rbxassetid://152572101",
  673. displayTex = "",
  674. sound = "rbxassetid://1016978163",
  675. soundVol = 2,
  676. hasGravity = false,
  677. objectType = "Block"
  678. },
  679. {
  680. name = "Bedrock",
  681. size = Vector3.new(2.6, 2.6, 2.6),
  682. transparency = 0;
  683. frontTex = "rbxassetid://75881126",
  684. backTex = "rbxassetid://75881126",
  685. topTex = "rbxassetid://75881126",
  686. bottomTex = "rbxassetid://75881126",
  687. leftTex = "rbxassetid://75881126",
  688. rightTex = "rbxassetid://75881126",
  689. displayTex = "",
  690. sound = "rbxassetid://1016978163",
  691. soundVol = 2,
  692. hasGravity = false,
  693. objectType = "Block"
  694. },
  695. {
  696. name = "Cobblestone",
  697. size = Vector3.new(2.6, 2.6, 2.6),
  698. transparency = 0;
  699. frontTex = "rbxassetid://152572105",
  700. backTex = "rbxassetid://152572105",
  701. topTex = "rbxassetid://152572105",
  702. bottomTex = "rbxassetid://152572105",
  703. leftTex = "rbxassetid://152572105",
  704. rightTex = "rbxassetid://152572105",
  705. displayTex = "",
  706. sound = "rbxassetid://1016978163",
  707. soundVol = 2,
  708. hasGravity = false,
  709. objectType = "Block"
  710. },
  711. {
  712. name = "Mossy Stone Brick",
  713. size = Vector3.new(2.6, 2.6, 2.6),
  714. transparency = 0;
  715. frontTex = "rbxassetid://61826751",
  716. backTex = "rbxassetid://61826751",
  717. topTex = "rbxassetid://61826751",
  718. bottomTex = "rbxassetid://61826751",
  719. leftTex = "rbxassetid://61826751",
  720. rightTex = "rbxassetid://61826751",
  721. displayTex = "",
  722. sound = "rbxassetid://1016978163",
  723. soundVol = 2,
  724. hasGravity = false,
  725. objectType = "Block"
  726. },
  727. {
  728. name = "Cracked Stone Brick",
  729. size = Vector3.new(2.6, 2.6, 2.6),
  730. transparency = 0;
  731. frontTex = "rbxassetid://151802087",
  732. backTex = "rbxassetid://151802087",
  733. topTex = "rbxassetid://151802087",
  734. bottomTex = "rbxassetid://151802087",
  735. leftTex = "rbxassetid://151802087",
  736. rightTex = "rbxassetid://151802087",
  737. displayTex = "",
  738. sound = "rbxassetid://1016978163",
  739. soundVol = 2,
  740. hasGravity = false,
  741. objectType = "Block"
  742. },
  743. {
  744. name = "Chiseled Stone Brick",
  745. size = Vector3.new(2.6, 2.6, 2.6),
  746. transparency = 0;
  747. frontTex = "rbxassetid://151802074",
  748. backTex = "rbxassetid://151802074",
  749. topTex = "rbxassetid://151802074",
  750. bottomTex = "rbxassetid://151802074",
  751. leftTex = "rbxassetid://151802074",
  752. rightTex = "rbxassetid://151802074",
  753. displayTex = "",
  754. sound = "rbxassetid://1016978163",
  755. soundVol = 2,
  756. hasGravity = false,
  757. objectType = "Block"
  758. },
  759. {
  760. name = "Stone Brick",
  761. size = Vector3.new(2.6, 2.6, 2.6),
  762. transparency = 0;
  763. frontTex = "rbxassetid://61826773",
  764. backTex = "rbxassetid://61826773",
  765. topTex = "rbxassetid://61826773",
  766. bottomTex = "rbxassetid://61826773",
  767. leftTex = "rbxassetid://61826773",
  768. rightTex = "rbxassetid://61826773",
  769. displayTex = "",
  770. sound = "rbxassetid://1016978163",
  771. soundVol = 2,
  772. hasGravity = false,
  773. objectType = "Block"
  774. },
  775. {
  776. name = "Nether Brick",
  777. size = Vector3.new(2.6, 2.6, 2.6),
  778. transparency = 0;
  779. frontTex = "rbxassetid://151802104",
  780. backTex = "rbxassetid://151802104",
  781. topTex = "rbxassetid://151802104",
  782. bottomTex = "rbxassetid://151802104",
  783. leftTex = "rbxassetid://151802104",
  784. rightTex = "rbxassetid://151802104",
  785. displayTex = "",
  786. sound = "rbxassetid://1016978163",
  787. soundVol = 2,
  788. hasGravity = false,
  789. objectType = "Block"
  790. },
  791. {
  792. name = "Granite",
  793. size = Vector3.new(2.6, 2.6, 2.6),
  794. transparency = 0;
  795. frontTex = "rbxassetid://151776467",
  796. backTex = "rbxassetid://151776467",
  797. topTex = "rbxassetid://151776467",
  798. bottomTex = "rbxassetid://151776467",
  799. leftTex = "rbxassetid://151776467",
  800. rightTex = "rbxassetid://151776467",
  801. displayTex = "",
  802. sound = "rbxassetid://1016978163",
  803. soundVol = 2,
  804. hasGravity = false,
  805. objectType = "Block"
  806. },
  807. {
  808. name = "Diorite",
  809. size = Vector3.new(2.6, 2.6, 2.6),
  810. transparency = 0;
  811. frontTex = "rbxassetid://151776452",
  812. backTex = "rbxassetid://151776452",
  813. topTex = "rbxassetid://151776452",
  814. bottomTex = "rbxassetid://151776452",
  815. leftTex = "rbxassetid://151776452",
  816. rightTex = "rbxassetid://151776452",
  817. sound = "rbxassetid://1016978163",
  818. soundVol = 2,
  819. hasGravity = false,
  820. objectType = "Block"
  821. },
  822. {
  823. name = "Andesite",
  824. size = Vector3.new(2.6, 2.6, 2.6),
  825. transparency = 0;
  826. frontTex = "rbxassetid://151776422",
  827. backTex = "rbxassetid://151776422",
  828. topTex = "rbxassetid://151776422",
  829. bottomTex = "rbxassetid://151776422",
  830. leftTex = "rbxassetid://151776422",
  831. rightTex = "rbxassetid://151776422",
  832. displayTex = "",
  833. sound = "rbxassetid://1016978163",
  834. soundVol = 2,
  835. hasGravity = false,
  836. objectType = "Block"
  837. },
  838. {
  839. name = "Polished Granite",
  840. size = Vector3.new(2.6, 2.6, 2.6),
  841. transparency = 0;
  842. frontTex = "rbxassetid://151776506",
  843. backTex = "rbxassetid://151776506",
  844. topTex = "rbxassetid://151776506",
  845. bottomTex = "rbxassetid://151776506",
  846. leftTex = "rbxassetid://151776506",
  847. rightTex = "rbxassetid://151776506",
  848. displayTex = "",
  849. sound = "rbxassetid://1016978163",
  850. soundVol = 2,
  851. hasGravity = false,
  852. objectType = "Block"
  853. },
  854. {
  855. name = "Polished Diorite",
  856. size = Vector3.new(2.6, 2.6, 2.6),
  857. transparency = 0;
  858. frontTex = "rbxassetid://151776533",
  859. backTex = "rbxassetid://151776533",
  860. topTex = "rbxassetid://151776533",
  861. bottomTex = "rbxassetid://151776533",
  862. leftTex = "rbxassetid://151776533",
  863. rightTex = "rbxassetid://151776533",
  864. displayTex = "",
  865. sound = "rbxassetid://1016978163",
  866. soundVol = 2,
  867. hasGravity = false,
  868. objectType = "Block"
  869. },
  870. {
  871. name = "Polished Andesite",
  872. size = Vector3.new(2.6, 2.6, 2.6),
  873. transparency = 0;
  874. frontTex = "rbxassetid://151776506",
  875. backTex = "rbxassetid://151776506",
  876. topTex = "rbxassetid://151776506",
  877. bottomTex = "rbxassetid://151776506",
  878. leftTex = "rbxassetid://151776506",
  879. rightTex = "rbxassetid://151776506",
  880. displayTex = "",
  881. sound = "rbxassetid://1016978163",
  882. soundVol = 2,
  883. hasGravity = false,
  884. objectType = "Block"
  885. },
  886. {
  887. name = "Brick Block",
  888. size = Vector3.new(2.6, 2.6, 2.6),
  889. transparency = 0;
  890. frontTex = "rbxassetid://59389191",
  891. backTex = "rbxassetid://59389191",
  892. topTex = "rbxassetid://59389191",
  893. bottomTex = "rbxassetid://59389191",
  894. leftTex = "rbxassetid://59389191",
  895. rightTex = "rbxassetid://59389191",
  896. displayTex = "",
  897. sound = "rbxassetid://1016978163",
  898. soundVol = 2,
  899. hasGravity = false,
  900. objectType = "Block"
  901. },
  902. {
  903. name = "Packed Ice",
  904. size = Vector3.new(2.6, 2.6, 2.6),
  905. transparency = 0;
  906. frontTex = "rbxassetid://152528023",
  907. backTex = "rbxassetid://152528023",
  908. topTex = "rbxassetid://152528023",
  909. bottomTex = "rbxassetid://152528023",
  910. leftTex = "rbxassetid://152528023",
  911. rightTex = "rbxassetid://152528023",
  912. displayTex = "",
  913. sound = "rbxassetid://1016978163",
  914. soundVol = 2,
  915. hasGravity = false,
  916. objectType = "Block"
  917. },
  918. {
  919. name = "Ice Block",
  920. size = Vector3.new(2.6, 2.6, 2.6),
  921. transparency = 1;
  922. frontTex = "rbxassetid://118555586",
  923. backTex = "rbxassetid://118555586",
  924. topTex = "rbxassetid://118555586",
  925. bottomTex = "rbxassetid://118555586",
  926. leftTex = "rbxassetid://118555586",
  927. rightTex = "rbxassetid://118555586",
  928. displayTex = "",
  929. sound = "rbxassetid://1016978163",
  930. soundVol = 2,
  931. hasGravity = false,
  932. objectType = "Block"
  933. },
  934. {
  935. name = "Netherrack",
  936. size = Vector3.new(2.6, 2.6, 2.6),
  937. transparency = 0;
  938. frontTex = "rbxassetid://151802119",
  939. backTex = "rbxassetid://151802119",
  940. topTex = "rbxassetid://151802119",
  941. bottomTex = "rbxassetid://151802119",
  942. leftTex = "rbxassetid://151802119",
  943. rightTex = "rbxassetid://151802119",
  944. displayTex = "",
  945. sound = "rbxassetid://1016978163",
  946. soundVol = 2,
  947. hasGravity = false,
  948. objectType = "Block"
  949. },
  950. {
  951. name = "End Stone",
  952. size = Vector3.new(2.6, 2.6, 2.6),
  953. transparency = 0;
  954. frontTex = "rbxassetid://151802091",
  955. backTex = "rbxassetid://151802091",
  956. topTex = "rbxassetid://151802091",
  957. bottomTex = "rbxassetid://151802091",
  958. leftTex = "rbxassetid://151802091",
  959. rightTex = "rbxassetid://151802091",
  960. displayTex = "",
  961. sound = "rbxassetid://1016978163",
  962. soundVol = 2,
  963. hasGravity = false,
  964. objectType = "Block"
  965. },
  966. {
  967. name = "Glass Block",
  968. size = Vector3.new(2.6, 2.6, 2.6),
  969. transparency = 1;
  970. frontTex = "rbxassetid://152239003",
  971. backTex = "rbxassetid://152239003",
  972. topTex = "rbxassetid://152239003",
  973. bottomTex = "rbxassetid://152239003",
  974. leftTex = "rbxassetid://152239003",
  975. rightTex = "rbxassetid://152239003",
  976. displayTex = "",
  977. sound = "rbxassetid://1016978163",
  978. soundVol = 2,
  979. hasGravity = false,
  980. objectType = "Block"
  981. },
  982. {
  983. name = "Glowstone",
  984. size = Vector3.new(2.6, 2.6, 2.6),
  985. transparency = 0;
  986. frontTex = "rbxassetid://54790811",
  987. backTex = "rbxassetid://54790811",
  988. topTex = "rbxassetid://54790811",
  989. bottomTex = "rbxassetid://54790811",
  990. leftTex = "rbxassetid://54790811",
  991. rightTex = "rbxassetid://54790811",
  992. displayTex = "",
  993. sound = "rbxassetid://1016978163",
  994. soundVol = 2,
  995. hasGravity = false,
  996. objectType = "Block"
  997. },
  998. {
  999. name = "Bookshelf",
  1000. size = Vector3.new(2.6, 2.6, 2.6),
  1001. transparency = 0;
  1002. frontTex = "rbxassetid://118554092",
  1003. backTex = "rbxassetid://118554092",
  1004. topTex = "rbxassetid://346201871",
  1005. bottomTex = "rbxassetid://346201871",
  1006. leftTex = "rbxassetid://118554092",
  1007. rightTex = "rbxassetid://118554092",
  1008. displayTex = "",
  1009. sound = "rbxassetid://507863457",
  1010. soundVol = 2,
  1011. hasGravity = false,
  1012. objectType = "Block"
  1013. },
  1014. {
  1015. name = "Oak Wood Planks",
  1016. size = Vector3.new(2.6, 2.6, 2.6),
  1017. transparency = 0;
  1018. frontTex = "rbxassetid://346201871",
  1019. backTex = "rbxassetid://346201871",
  1020. topTex = "rbxassetid://346201871",
  1021. bottomTex = "rbxassetid://346201871",
  1022. leftTex = "rbxassetid://346201871",
  1023. rightTex = "rbxassetid://346201871",
  1024. displayTex = "",
  1025. sound = "rbxassetid://507863457",
  1026. soundVol = 2,
  1027. hasGravity = false,
  1028. objectType = "Block"
  1029. },
  1030. {
  1031. name = "Oak Log",
  1032. size = Vector3.new(2.6, 2.6, 2.6),
  1033. transparency = 0;
  1034. frontTex = "rbxassetid://71445924",
  1035. backTex = "rbxassetid://71445924",
  1036. topTex = "rbxassetid://152538557",
  1037. bottomTex = "rbxassetid://152538557",
  1038. leftTex = "rbxassetid://71445924",
  1039. rightTex = "rbxassetid://71445924",
  1040. displayTex = "",
  1041. sound = "rbxassetid://507863457",
  1042. soundVol = 2,
  1043. hasGravity = false,
  1044. objectType = "Block"
  1045. },
  1046. {
  1047. name = "Oak Leaves",
  1048. size = Vector3.new(2.6, 2.6, 2.6),
  1049. transparency = 1;
  1050. frontTex = "rbxassetid://151708391",
  1051. backTex = "rbxassetid://151708391",
  1052. topTex = "rbxassetid://151708391",
  1053. bottomTex = "rbxassetid://151708391",
  1054. leftTex = "rbxassetid://151708391",
  1055. rightTex = "rbxassetid://151708391",
  1056. displayTex = "",
  1057. sound = "rbxassetid://507863457",
  1058. -- couldn't find a leaves sound for this one, sorry lol
  1059. soundVol = 2,
  1060. hasGravity = false,
  1061. objectType = "Block"
  1062. }
  1063. }
  1064. local toolBar = {
  1065. {
  1066. name = "Dirt Block",
  1067. size = Vector3.new(2.6, 2.6, 2.6),
  1068. transparency = 0;
  1069. frontTex = "rbxassetid://152569532",
  1070. backTex = "rbxassetid://152569532",
  1071. topTex = "rbxassetid://152569532",
  1072. bottomTex = "rbxassetid://152569532",
  1073. leftTex = "rbxassetid://152569532",
  1074. rightTex = "rbxassetid://152569532",
  1075. displayTex = "",
  1076. sound = "rbxassetid://1102186681",
  1077. soundVol = 1.25,
  1078. hasGravity = false,
  1079. objectType = "Block"
  1080. },
  1081. {
  1082. name = "Grass Block",
  1083. size = Vector3.new(2.6, 2.6, 2.6),
  1084. transparency = 0;
  1085. frontTex = "rbxassetid://96430337",
  1086. backTex = "rbxassetid://96430337",
  1087. topTex = "rbxassetid://96430265",
  1088. bottomTex = "rbxassetid://179655033",
  1089. leftTex = "rbxassetid://96430337",
  1090. rightTex = "rbxassetid://96430337",
  1091. displayTex = "",
  1092. sound = "rbxassetid://1102186681",
  1093. soundVol = 1.25,
  1094. hasGravity = false,
  1095. objectType = "Block"
  1096. },
  1097. {
  1098. name = "Stone",
  1099. size = Vector3.new(2.6, 2.6, 2.6),
  1100. transparency = 0;
  1101. frontTex = "rbxassetid://75880927",
  1102. backTex = "rbxassetid://75880927",
  1103. topTex = "rbxassetid://75880927",
  1104. bottomTex = "rbxassetid://75880927",
  1105. leftTex = "rbxassetid://75880927",
  1106. rightTex = "rbxassetid://75880927",
  1107. displayTex = "",
  1108. sound = "rbxassetid://1016978163",
  1109. soundVol = 2,
  1110. hasGravity = false,
  1111. objectType = "Block"
  1112. },
  1113. {
  1114. name = "Diamond Ore",
  1115. size = Vector3.new(2.6, 2.6, 2.6),
  1116. transparency = 0;
  1117. frontTex = "rbxassetid://152572119",
  1118. backTex = "rbxassetid://152572119",
  1119. topTex = "rbxassetid://152572119",
  1120. bottomTex = "rbxassetid://152572119",
  1121. leftTex = "rbxassetid://152572119",
  1122. rightTex = "rbxassetid://152572119",
  1123. displayTex = "",
  1124. sound = "rbxassetid://1016978163",
  1125. soundVol = 2,
  1126. hasGravity = false,
  1127. objectType = "Block"
  1128. },
  1129. {
  1130. name = "Diamond Block",
  1131. size = Vector3.new(2.6, 2.6, 2.6),
  1132. transparency = 0;
  1133. frontTex = "rbxassetid://56749955",
  1134. backTex = "rbxassetid://56749955",
  1135. topTex = "rbxassetid://56749955",
  1136. bottomTex = "rbxassetid://56749955",
  1137. leftTex = "rbxassetid://56749955",
  1138. rightTex = "rbxassetid://56749955",
  1139. displayTex = "",
  1140. sound = "rbxassetid://1016978163",
  1141. soundVol = 2,
  1142. hasGravity = false,
  1143. objectType = "Block"
  1144. },
  1145. {
  1146. name = "Oak Wood Planks",
  1147. size = Vector3.new(2.6, 2.6, 2.6),
  1148. transparency = 0;
  1149. frontTex = "rbxassetid://346201871",
  1150. backTex = "rbxassetid://346201871",
  1151. topTex = "rbxassetid://346201871",
  1152. bottomTex = "rbxassetid://346201871",
  1153. leftTex = "rbxassetid://346201871",
  1154. rightTex = "rbxassetid://346201871",
  1155. displayTex = "",
  1156. sound = "rbxassetid://507863457",
  1157. soundVol = 2,
  1158. hasGravity = false,
  1159. objectType = "Block"
  1160. },
  1161. {
  1162. name = "Oak Log",
  1163. size = Vector3.new(2.6, 2.6, 2.6),
  1164. transparency = 0;
  1165. frontTex = "rbxassetid://71445924",
  1166. backTex = "rbxassetid://71445924",
  1167. topTex = "rbxassetid://152538557",
  1168. bottomTex = "rbxassetid://152538557",
  1169. leftTex = "rbxassetid://71445924",
  1170. rightTex = "rbxassetid://71445924",
  1171. displayTex = "",
  1172. sound = "rbxassetid://507863457",
  1173. soundVol = 2,
  1174. hasGravity = false,
  1175. objectType = "Block"
  1176. }
  1177. --[[{
  1178. name = "Redstone",
  1179. size = Vector3.new(2.6, 0.05, 2.6),
  1180. transparency = 1;
  1181. frontTex = "rbxassetid://151911305",
  1182. backTex = "",
  1183. topTex = "rbxassetid://151911305",
  1184. bottomTex = "",
  1185. leftTex = "",
  1186. rightTex = "",
  1187. displayTex = "rbxassetid://64124418",
  1188. sound = "rbxassetid://1016978163",
  1189. soundVol = 2,
  1190. hasGravity = false,
  1191. objectType = "Redstone Dust"
  1192. },]]
  1193. }
  1194. function putInventorySlot(position, image, parent, zindex)
  1195. local button = Instance.new("TextButton", parent)
  1196. button.Position = position
  1197. button.Size = UDim2.new(0, 36, 0, 36)
  1198. button.BackgroundColor3 = Color3.new(139/255, 139/255, 139/255)
  1199. button.Text = ""
  1200. button.BorderSizePixel = 0
  1201. button.ZIndex = zindex
  1202. local imageLabel = Instance.new("ImageLabel", button)
  1203. imageLabel.BackgroundTransparency = 0.9
  1204. imageLabel.Position = UDim2.new(0, 2, 0, 2)
  1205. imageLabel.Size = UDim2.new(0, 32, 0, 32)
  1206. imageLabel.Image = image
  1207. imageLabel.BorderSizePixel = 0
  1208. imageLabel.ZIndex = zindex
  1209. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 34, 0, 2),
  1210. Color3.new(55/255, 55/255, 55/255), 0, button, zindex)
  1211. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 2, 0, 34),
  1212. Color3.new(55/255, 55/255, 55/255), 0, button, zindex)
  1213. makeSquare(UDim2.new(0, 34, 0, 2), UDim2.new(0, 2, 0, 34),
  1214. Color3.new(255/255, 255/255, 255/255), 0, button, zindex)
  1215. makeSquare(UDim2.new(0, 2, 0, 34), UDim2.new(0, 34, 0, 2),
  1216. Color3.new(255/255, 255/255, 255/255), 0, button, zindex)
  1217. return button
  1218. end
  1219. if player and player.Character.Humanoid.Health ~= 0 then
  1220. for i,v in pairs(game.Players:GetChildren()) do
  1221. coroutine.resume(coroutine.create(function()
  1222. local sc = Instance.new("ScreenGui",v.PlayerGui)
  1223. local frame = Instance.new("Frame",sc)
  1224. frame.Position = UDim2.new(0,0,0.796,0)
  1225. frame.Size = UDim2.new(0,518,0,112)
  1226. frame.BackgroundTransparency = 1
  1227. local textLabel = Instance.new("TextLabel",frame)
  1228. textLabel.Text = player.Name.." has joined the game."
  1229. textLabel.TextSize = 24
  1230. textLabel.Font = "Arcade"
  1231. textLabel.Size = UDim2.new(1,0,1,0)
  1232. textLabel.Position = UDim2.new(0,1,0,1)
  1233. textLabel.BackgroundTransparency = 0.5
  1234. textLabel.BackgroundColor3 = Color3.new(0, 0, 0)
  1235. textLabel.TextColor3 = Color3.new(255, 255, 0)
  1236. wait(5)
  1237. textLabel.Visible = false
  1238. end))
  1239. end
  1240. local char = player.Character
  1241. local diedtofalldamage = false
  1242. local damageHeight = 6.76 -- The height at which the player will start getting damaged at
  1243. local lethalHeight = 59.8 -- The height at which the player will get killed
  1244.  
  1245. local root = char:WaitForChild("HumanoidRootPart")
  1246. local humanoid = char:WaitForChild("Humanoid")
  1247. Gravity = -0.9
  1248. humanoid.JumpPower = 30
  1249. BodyForce = Instance.new("BodyForce")
  1250. BodyForce.force = Vector3.new(0, (1-Gravity) * root:GetMass() * 236 / 1.2, 0)
  1251. BodyForce:clone().Parent = root
  1252.  
  1253. if humanoid and root then
  1254.  
  1255. local headHeight
  1256. humanoid.FreeFalling:Connect(function (state)
  1257. if state then
  1258. headHeight = root.Position.Y
  1259. elseif not state and headHeight ~= nil then
  1260. pcall(function ()
  1261.  
  1262. local fell = headHeight - root.Position.Y
  1263.  
  1264. if fell >= lethalHeight then
  1265. humanoid.Health = 0
  1266. diedtofalldamage = true
  1267. wait()
  1268. for i,v in pairs(game.Players:GetChildren()) do
  1269. if v.PlayerGui:FindFirstChild("TextLabel").Text == player.Name.. "Died" then
  1270. v:FindFirstChild("TextLabel").Text = player.Name.. "fell from a high place"
  1271. end
  1272. end
  1273. elseif fell >= damageHeight then
  1274. humanoid.Health = humanoid.Health - math.floor(fell)
  1275. end
  1276. end)
  1277. end
  1278. end)
  1279. end
  1280. minecrafttheme = Instance.new("Sound",char)
  1281. minecrafttheme.SoundId = "rbxassetid://4611987152"
  1282. minecrafttheme.Volume = 0.5
  1283. --minecrafttheme:Play()
  1284. minecrafttheme.Looped = true
  1285. minecrafttheme:Play()
  1286. Step1 = Instance.new("Sound",char.HumanoidRootPart)
  1287. Step1.SoundId = "rbxassetid://507863105"
  1288. Step1.Volume = 1
  1289. Step1.PlaybackSpeed = 1
  1290. Step2 = Instance.new("Sound",char.HumanoidRootPart)
  1291. Step2.SoundId = "rbxassetid://507863105"
  1292. Step2.Volume = 1
  1293. Step2.PlaybackSpeed = 1
  1294. char:FindFirstChildOfClass("Humanoid").DisplayDistanceType = "None"
  1295.  
  1296. if char then
  1297. local d = char:GetChildren()
  1298. for i=1, #d do
  1299. if (d[i].className == "Accessory") then
  1300. d[i]:remove()
  1301. end
  1302. if (d[i].className == "Hat") then
  1303. d[i]:remove()
  1304. end
  1305. end
  1306.  
  1307. local draggingBlock = nil
  1308. function makeInventory()
  1309. local playerGui = player:FindFirstChild("PlayerGui")
  1310. if playerGui then
  1311. local invGui = Instance.new("ScreenGui", playerGui)
  1312. local creativeInv = Instance.new("Frame", invGui)
  1313. creativeInv.BackgroundTransparency = 1
  1314. creativeInv.Position = UDim2.new(0.5, -170, 0.5, -202)
  1315.  
  1316. creativeInv.Visible = false
  1317.  
  1318. -- creative inventory GUI...
  1319.  
  1320. local blackOut = makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(1, 0, 1, 0),
  1321. Color3.new(0/255, 0/255, 0/255), 0.3, invGui, 1)
  1322. blackOut.Visible = false
  1323.  
  1324. creativeInv.Changed:connect(function()
  1325. blackOut.Visible = creativeInv.Visible
  1326. end)
  1327.  
  1328. local changeLog = Instance.new("TextLabel", invGui)
  1329. changeLog.Text = Changelog
  1330. changeLog.Font = "SourceSans"
  1331. changeLog.FontSize = Enum.FontSize.Size12
  1332. changeLog.Size = UDim2.new(0, changeLog.TextBounds.X, 0, changeLog.TextBounds.Y + 2)
  1333. changeLog.BackgroundColor3 = Color3.new(0, 0, 0)
  1334. changeLog.BorderSizePixel = 0
  1335. changeLog.BackgroundTransparency = 0.5
  1336. changeLog.Position = UDim2.new(0.5, -changeLog.Size.X.Offset/2, 0.5, -changeLog.Size.Y.Offset/2)
  1337. changeLog.TextColor3 = Color3.new(1, 1, 1)
  1338. changeLog.TextXAlignment = "Left"
  1339. changeLog.TextYAlignment = "Top"
  1340.  
  1341. local coolButton = Instance.new("TextButton", changeLog)
  1342. coolButton.Position = UDim2.new(1, -17, 0, 1)
  1343. coolButton.Size = UDim2.new(0, 16, 0, 12)
  1344. coolButton.Text = "X"
  1345. coolButton.Font = "SourceSans"
  1346. coolButton.FontSize = Enum.FontSize.Size12
  1347. coolButton.BorderSizePixel = 0
  1348. coolButton.BackgroundColor3 = Color3.new(1, 0, 0)
  1349. coolButton.BackgroundTransparency = 0.2
  1350. coolButton.TextColor3 = Color3.new(1, 1, 1)
  1351. coolButton.TextStrokeTransparency = 0.5
  1352. coolButton.ZIndex = 2
  1353.  
  1354. local line = makeSquare(UDim2.new(0, 0, 1, -14), UDim2.new(1, 0, 0, 14),
  1355. Color3.new(0, 0, 0), 0.75, changeLog, 2)
  1356.  
  1357. local line2 = makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(1, 0, 0, 14),
  1358. Color3.new(1, 1, 1), 0.9, changeLog, 1)
  1359.  
  1360. line2.Text = "Change Log"
  1361. line2.TextColor3 = Color3.new(1, 1, 1)
  1362. line2.TextStrokeTransparency = 0.75
  1363. line2.Font = "SourceSans"
  1364. line2.FontSize = Enum.FontSize.Size12
  1365.  
  1366. line.Text = "Made by Depr1 (Hes the original creator)"
  1367. line.TextColor3 = Color3.new(1, 0.65, 0)
  1368. line.TextStrokeTransparency = 0.5
  1369. line.Font = "SourceSans"
  1370. line.FontSize = Enum.FontSize.Size14
  1371. line.TextXAlignment = "Left"
  1372.  
  1373. coolButton.MouseButton1Click:connect(function()
  1374. changeLog.Visible = false
  1375. end)
  1376.  
  1377. makeSquare(UDim2.new(0, -2, 0, 2), UDim2.new(0, 340, 0, 404),
  1378. Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 3)
  1379. makeSquare(UDim2.new(0, 338, 0, 0), UDim2.new(0, 6, 0, 406),
  1380. Color3.new(85/255, 85/255, 85/255), 0, creativeInv, 2)
  1381. makeSquare(UDim2.new(0, 0, 0, 404), UDim2.new(0, 342, 0, 4),
  1382. Color3.new(85/255, 85/255, 85/255), 0, creativeInv, 3)
  1383. makeSquare(UDim2.new(0, 2, 0, 0), UDim2.new(0, 338, 0, 402),
  1384. Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 3)
  1385. makeSquare(UDim2.new(0, -4, 0, -2), UDim2.new(0, 4, 0, 406),
  1386. Color3.new(255/255, 255/255, 255/255), 0, creativeInv, 3)
  1387. makeSquare(UDim2.new(0, -2, 0, -4), UDim2.new(0, 342, 0, 6),
  1388. Color3.new(255/255, 255/255, 255/255), 0, creativeInv, 2)
  1389. makeSquare(UDim2.new(0, 340, 0, -2), UDim2.new(0, 2, 0, 2),
  1390. Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 2)
  1391. makeSquare(UDim2.new(0, 340, 0, -4), UDim2.new(0, 2, 0, 4),
  1392. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1393. makeSquare(UDim2.new(0, 342, 0, -2), UDim2.new(0, 2, 0, 2),
  1394. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1395. makeSquare(UDim2.new(0, 344, 0, 0), UDim2.new(0, 2, 0, 406),
  1396. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1397. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 2, 0, 4),
  1398. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1399. makeSquare(UDim2.new(0, -2, 0, -6), UDim2.new(0, 342, 0, 4),
  1400. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1401. makeSquare(UDim2.new(0, 0, 0, 406), UDim2.new(0, 342, 0, 4),
  1402. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1403. makeSquare(UDim2.new(0, 342, 0, 404), UDim2.new(0, 2, 0, 4),
  1404. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1405. makeSquare(UDim2.new(0, -4, 0, 404), UDim2.new(0, 2, 0, 2),
  1406. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1407. makeSquare(UDim2.new(0, -2, 0, 406), UDim2.new(0, 2, 0, 2),
  1408. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1409. makeSquare(UDim2.new(0, -6, 0, -2), UDim2.new(0, 2, 0, 406),
  1410. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1411. local text = makeSquare(UDim2.new(0, 4, 0, 8), UDim2.new(0, 0, 0, 0), Color3.new(0/255, 0/255, 0/255), 1, creativeInv, 3)
  1412. text.Text = "Creative Inventory"
  1413. text.Font = "SourceSansSemibold"
  1414. text.TextSize = 14
  1415. text.TextXAlignment = "Left"
  1416. --
  1417. local draggingBlockPicture = Instance.new("ImageLabel", invGui)
  1418. draggingBlockPicture.BackgroundTransparency = 1
  1419. draggingBlockPicture.Size = UDim2.new(0, 32, 0, 32)
  1420. draggingBlockPicture.ZIndex = 5
  1421. coroutine.resume(coroutine.create(function()
  1422. local invMouse = player:GetMouse()
  1423. --local RS = game:GetService("RunService").RenderStepped
  1424. invMouse.Button2Down:connect(function()
  1425. draggingBlock = nil
  1426. end)
  1427. while RS:wait() do
  1428. draggingBlockPicture.Position = UDim2.new(0, invMouse.X - 16, 0, invMouse.Y - 16)
  1429. if draggingBlock ~= nil then
  1430. draggingBlockPicture.Image = draggingBlock.frontTex
  1431. else
  1432. draggingBlockPicture.Image = ""
  1433. end
  1434. end
  1435. end))
  1436.  
  1437. local done = false
  1438. local x = 0
  1439. local y = 0
  1440.  
  1441. for i,b in pairs(creativeInventory) do
  1442. local display = ""
  1443. if b.displayTex == "" then
  1444. display = b.frontTex
  1445. else
  1446. if b.displayTex then
  1447. display = b.displayTex
  1448. end
  1449. end
  1450. putInventorySlot(UDim2.new(0.5, (x*36) + 8, 0.5, (y*36) + 28), display, creativeInv, 4).MouseButton1Down:connect(function()
  1451. if draggingBlock == nil then
  1452. draggingBlock = b
  1453. end
  1454. end)
  1455. x = x + 1
  1456. if x >= 8 then
  1457. x = 0
  1458. y = y + 1
  1459. end
  1460. end
  1461. if x == 0 then done = true end
  1462. while x < 8 and done == false do
  1463. putInventorySlot(UDim2.new(0.5, (x*36) + 8, 0.5, (y*36) + 28), "", creativeInv, 4)
  1464. x = x + 1
  1465. end
  1466. for i = 1, 9 do
  1467. if toolBar[i] ~= nil then
  1468. local invSlot = putInventorySlot(UDim2.new(0, 8 + ((i-1)*36), 0, 360), toolBar[i].frontTex, creativeInv, 4)
  1469. invSlot.MouseButton2Down:connect(function()
  1470. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  1471. if imgLabel then
  1472. toolBar[i] = nil
  1473. imgLabel.Image = ""
  1474. end
  1475. end)
  1476. invSlot.MouseButton1Down:connect(function()
  1477. --updateHand = true
  1478. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  1479. if toolBar[i] == nil then
  1480. toolBar[i] = draggingBlock
  1481. imgLabel.Image = draggingBlock.frontTex
  1482. draggingBlock = nil
  1483. return
  1484. end
  1485. if toolBar[i] ~= nil and draggingBlock == nil then
  1486. draggingBlock = toolBar[i]
  1487. toolBar[i] = nil
  1488. imgLabel.Image = ""
  1489. return
  1490. elseif toolBar[i] ~= nil and draggingBlock ~= nil then
  1491. --draggingBlock = toolBar[i]
  1492. --toolBar[i] = nil
  1493. imgLabel.Image = ""
  1494. local temp = toolBar[i]
  1495. toolBar[i] = draggingBlock
  1496. if imgLabel and draggingBlock ~= nil then
  1497. imgLabel.Image = draggingBlock.frontTex
  1498. end
  1499. if imgLabel and draggingBlock == nil then
  1500. imgLabel.Image = ""
  1501. end
  1502. draggingBlock = temp
  1503. return
  1504. end
  1505. end)
  1506. else
  1507. local invSlot = putInventorySlot(UDim2.new(0, 8 + ((i-1)*36), 0, 360), "", creativeInv, 4)
  1508. invSlot.MouseButton2Down:connect(function()
  1509. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  1510. if imgLabel then
  1511. toolBar[i] = nil
  1512. imgLabel.Image = ""
  1513. end
  1514. end)
  1515. invSlot.MouseButton1Down:connect(function()
  1516. --updateHand = true
  1517. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  1518. if toolBar[i] == nil then
  1519. toolBar[i] = draggingBlock
  1520. imgLabel.Image = draggingBlock.frontTex
  1521. draggingBlock = nil
  1522. return
  1523. end
  1524. if toolBar[i] ~= nil and draggingBlock == nil then
  1525. draggingBlock = toolBar[i]
  1526. toolBar[i] = nil
  1527. imgLabel.Image = ""
  1528. return
  1529. elseif toolBar[i] ~= nil and draggingBlock ~= nil then
  1530. --draggingBlock = toolBar[i]
  1531. --toolBar[i] = nil
  1532. imgLabel.Image = ""
  1533. local temp = toolBar[i]
  1534. toolBar[i] = draggingBlock
  1535. if imgLabel and draggingBlock ~= nil then
  1536. imgLabel.Image = draggingBlock.frontTex
  1537. end
  1538. if imgLabel and draggingBlock == nil then
  1539. imgLabel.Image = ""
  1540. end
  1541. draggingBlock = temp
  1542. return
  1543. end
  1544. end)
  1545. end
  1546. end
  1547. return creativeInv
  1548. end
  1549. end
  1550.  
  1551.  
  1552. --[]
  1553. local gui = player.PlayerGui:FindFirstChild("ToolBar") or Instance.new("ScreenGui", player.PlayerGui)
  1554. gui.Name = "ToolBar"
  1555.  
  1556. makeSquare(UDim2.new(0.5, -166, 1, -111), UDim2.new(0, 364, 0, 44),
  1557. Color3.new(0/255, 0/255, 0/255), 0, gui)
  1558.  
  1559. local blocks = {"Dirt", "Grass", "Stone", "Diamond_Ore", "Diamond_Block", "Wood_Planks", "Oak_Log"}
  1560. for i = 1, 9 do
  1561. if toolBar[blocks[i]] ~= nil then
  1562. putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), toolBar[blocks[i]].frontTex)
  1563. else
  1564. putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), "")
  1565. end
  1566. end
  1567.  
  1568. for i = 1, 9 do
  1569. if toolBar[i] ~= nil then
  1570. local img = putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), toolBar[i].frontTex)
  1571. coroutine.resume(coroutine.create(function()
  1572. while wait() do
  1573. if toolBar[i] ~= nil then
  1574. if toolBar[i].displayTex == "" then
  1575. img.Image = toolBar[i].frontTex
  1576. else
  1577. img.Image = toolBar[i].displayTex
  1578. end
  1579. else
  1580. img.Image = ""
  1581. end
  1582. end
  1583. end))
  1584. else
  1585. local img = putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), "")
  1586. coroutine.resume(coroutine.create(function()
  1587. while wait() do
  1588. if toolBar[i] ~= nil then
  1589. if toolBar[i].displayTex == "" then
  1590. img.Image = toolBar[i].frontTex
  1591. else
  1592. img.Image = toolBar[i].displayTex
  1593. end
  1594. else
  1595. img.Image = ""
  1596. end
  1597. end
  1598. end))
  1599. end
  1600. end
  1601. local creativeInventoryGUI = makeInventory()
  1602.  
  1603. local humRootPart = char:WaitForChild("HumanoidRootPart")
  1604. local head = char:WaitForChild("Head")
  1605. local torso = char:WaitForChild("Torso")
  1606. local lArm = char:WaitForChild("Left Arm")
  1607. local rArm = char:WaitForChild("Right Arm")
  1608. local lLeg = char:WaitForChild("Left Leg")
  1609. local rLeg = char:WaitForChild("Right Leg")
  1610. head.Size = Vector3.new(1.3, 1.656, 1.3)
  1611. head:WaitForChild("Mesh"):Destroy()
  1612. head:WaitForChild("face"):Destroy()
  1613.  
  1614. headdecal6 = Instance.new("Decal",head)
  1615. headdecal6.Face = "Front"
  1616. headdecal6.Texture = faces[math.random(1,#faces)]
  1617. if headdecal6.Texture == "http://www.roblox.com/asset/?id=111288035" then
  1618. torsodecal1 = Instance.new("Decal",torso)
  1619. torsodecal1.Face = "Left"
  1620. torsodecal1.Texture = "http://www.roblox.com/asset/?id=111290766"
  1621. torsodecal2 = Instance.new("Decal",torso)
  1622. torsodecal2.Face = "Bottom"
  1623. torsodecal2.Texture = "http://www.roblox.com/asset/?id=111290905"
  1624. torsodecal3 = Instance.new("Decal",torso)
  1625. torsodecal3.Face = "Top"
  1626. torsodecal3.Texture = "http://www.roblox.com/asset/?id=38934780"
  1627. torsodecal4 = Instance.new("Decal",torso)
  1628. torsodecal4.Face = "Back"
  1629. torsodecal4.Texture = "http://www.roblox.com/asset/?id=111289318"
  1630. torsodecal5 = Instance.new("Decal",torso)
  1631. torsodecal5.Face = "Right"
  1632. torsodecal5.Texture = "http://www.roblox.com/asset/?id=111290905"
  1633. torsodecal6 = Instance.new("Decal",torso)
  1634. torsodecal6.Face = "Front"
  1635. torsodecal6.Texture = "http://www.roblox.com/asset/?id=111289291"
  1636. for i,v in pairs(char:GetChildren()) do
  1637. if v.ClassName == "Part" and v.Name == "Left Leg" then
  1638. torsodecal1 = Instance.new("Decal",v)
  1639. torsodecal1.Face = "Left"
  1640. torsodecal1.Texture = "http://www.roblox.com/asset/?id=111292718"
  1641. torsodecal2 = Instance.new("Decal",v)
  1642. torsodecal2.Face = "Bottom"
  1643. torsodecal2.Texture = "http://www.roblox.com/asset/?id=38934712"
  1644. torsodecal3 = Instance.new("Decal",v)
  1645. torsodecal3.Face = "Top"
  1646. torsodecal3.Texture = "http://www.roblox.com/asset/?id=111291534"
  1647. torsodecal4 = Instance.new("Decal",v)
  1648. torsodecal4.Face = "Back"
  1649. torsodecal4.Texture = "http://www.roblox.com/asset/?id=111292729"
  1650. torsodecal5 = Instance.new("Decal",v)
  1651. torsodecal5.Face = "Right"
  1652. torsodecal5.Texture = "http://www.roblox.com/asset/?id=111292704"
  1653. torsodecal6 = Instance.new("Decal",v)
  1654. torsodecal6.Face = "Front"
  1655. torsodecal6.Texture = "http://www.roblox.com/asset/?id=111292682"
  1656. elseif v.ClassName == "Part" and v.Name == "Right Leg" then
  1657. torsodecal1 = Instance.new("Decal",v)
  1658. torsodecal1.Face = "Left"
  1659. torsodecal1.Texture = "http://www.roblox.com/asset/?id=111292718"
  1660. torsodecal2 = Instance.new("Decal",v)
  1661. torsodecal2.Face = "Bottom"
  1662. torsodecal2.Texture = "http://www.roblox.com/asset/?id=38934712"
  1663. torsodecal3 = Instance.new("Decal",v)
  1664. torsodecal3.Face = "Top"
  1665. torsodecal3.Texture = "http://www.roblox.com/asset/?id=111291534"
  1666. torsodecal4 = Instance.new("Decal",v)
  1667. torsodecal4.Face = "Back"
  1668. torsodecal4.Texture = "http://www.roblox.com/asset/?id=111292682"
  1669. torsodecal5 = Instance.new("Decal",v)
  1670. torsodecal5.Face = "Right"
  1671. torsodecal5.Texture = "http://www.roblox.com/asset/?id=111292704"
  1672. torsodecal6 = Instance.new("Decal",v)
  1673. torsodecal6.Face = "Front"
  1674. torsodecal6.Texture = "http://www.roblox.com/asset/?id=111292729"
  1675. elseif v.ClassName == "Part" and v.Name == "Left Arm" then
  1676. torsodecal1 = Instance.new("Decal",v)
  1677. torsodecal1.Face = "Left"
  1678. torsodecal1.Texture = "http://www.roblox.com/asset/?id=111291643"
  1679. torsodecal2 = Instance.new("Decal",v)
  1680. torsodecal2.Face = "Bottom"
  1681. torsodecal2.Texture = "http://www.roblox.com/asset/?id=111291534"
  1682. torsodecal3 = Instance.new("Decal",v)
  1683. torsodecal3.Face = "Top"
  1684. torsodecal3.Texture = "http://www.roblox.com/asset/?id=111291326"
  1685. torsodecal4 = Instance.new("Decal",v)
  1686. torsodecal4.Face = "Back"
  1687. torsodecal4.Texture = "http://www.roblox.com/asset/?id=111291741"
  1688. torsodecal5 = Instance.new("Decal",v)
  1689. torsodecal5.Face = "Right"
  1690. torsodecal5.Texture = "http://www.roblox.com/asset/?id=111291643"
  1691. torsodecal6 = Instance.new("Decal",v)
  1692. torsodecal6.Face = "Front"
  1693. torsodecal6.Texture = "http://www.roblox.com/asset/?id=111291741"
  1694. elseif v.ClassName == "Part" and v.Name == "Right Arm" then
  1695. torsodecal1 = Instance.new("Decal",v)
  1696. torsodecal1.Face = "Left"
  1697. torsodecal1.Texture = "http://www.roblox.com/asset/?id=111291643"
  1698. torsodecal2 = Instance.new("Decal",v)
  1699. torsodecal2.Face = "Bottom"
  1700. torsodecal2.Texture = "http://www.roblox.com/asset/?id=111291534"
  1701. torsodecal3 = Instance.new("Decal",v)
  1702. torsodecal3.Face = "Top"
  1703. torsodecal3.Texture = "http://www.roblox.com/asset/?id=111291326"
  1704. torsodecal4 = Instance.new("Decal",v)
  1705. torsodecal4.Face = "Back"
  1706. torsodecal4.Texture = "http://www.roblox.com/asset/?id=111291741"
  1707. torsodecal5 = Instance.new("Decal",v)
  1708. torsodecal5.Face = "Right"
  1709. torsodecal5.Texture = "http://www.roblox.com/asset/?id=111291643"
  1710. torsodecal6 = Instance.new("Decal",v)
  1711. torsodecal6.Face = "Front"
  1712. torsodecal6.Texture = "http://www.roblox.com/asset/?id=111291741"
  1713. end
  1714. end
  1715.  
  1716. torso.Size = Vector3.new(1.3, 1.95, 0.65)
  1717. lArm.Size = Vector3.new(0.65, 1.95, 0.65)
  1718. rArm.Size = Vector3.new(0.65, 1.95, 0.65)
  1719. lLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  1720. rLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  1721. lS = Instance.new("Motor6D", torso)
  1722. lS.Name = "Left Shoulder"
  1723. lS.Part0 = lArm
  1724. lS.Part1 = torso
  1725. lS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  1726. lS.C1 = CFrame.new(0.65, 0.975, 0)
  1727.  
  1728. rS = Instance.new("Motor6D", torso)
  1729. rS.Name = "Right Shoulder"
  1730. rS.Part0 = rArm
  1731. rS.Part1 = torso
  1732. rS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  1733. rS.C1 = CFrame.new(-0.65, 0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  1734.  
  1735. char.Humanoid:ClearAllChildren()
  1736. --char.Animate:Remove()
  1737. for _,cM in pairs(char:GetChildren()) do
  1738. if cM.ClassName == "CharacterMesh" then cM:Destroy() end
  1739. end
  1740. Instance.new("BlockMesh", torso)
  1741. Instance.new("BlockMesh", lLeg)
  1742. Instance.new("BlockMesh", rLeg)
  1743. Instance.new("BlockMesh", lArm)
  1744. Instance.new("BlockMesh", rArm)
  1745. headdecal1 = Instance.new("Decal",head)
  1746. headdecal1.Face = "Left"
  1747. headdecal1.Texture = "http://www.roblox.com/asset/?id=111289140"
  1748. headdecal2 = Instance.new("Decal",head)
  1749. headdecal2.Face = "Bottom"
  1750. headdecal2.Texture = "http://www.roblox.com/asset/?id=111292912"
  1751. headdecal3 = Instance.new("Decal",head)
  1752. headdecal3.Face = "Top"
  1753. headdecal3.Texture = "http://www.roblox.com/asset/?id=111289156"
  1754. headdecal4 = Instance.new("Decal",head)
  1755. headdecal4.Face = "Back"
  1756. headdecal4.Texture = "http://www.roblox.com/asset/?id=111289140"
  1757. headdecal5 = Instance.new("Decal",head)
  1758. headdecal5.Face = "Right"
  1759. headdecal5.Texture = "http://www.roblox.com/asset/?id=111289140"
  1760. head1 = Instance.new("Part",head)
  1761. head1.Size = Vector3.new(0.304, 0.66, 0.304)
  1762. head1weld = Instance.new("Weld",head1)
  1763. head1weld.Part0 = head
  1764. head1weld.Part1 = head1
  1765. v = head1
  1766. head1weld.C0 = CFrame.new(0,-0.664,-0.81)
  1767. torsodecal1 = Instance.new("Decal",v)
  1768. torsodecal1.Face = "Left"
  1769. torsodecal1.Texture = "http://www.roblox.com/asset/?id=111291021"
  1770. torsodecal2 = Instance.new("Decal",v)
  1771. torsodecal2.Face = "Bottom"
  1772. torsodecal2.Texture = "http://www.roblox.com/asset/?id=111291021"
  1773. torsodecal3 = Instance.new("Decal",v)
  1774. torsodecal3.Face = "Top"
  1775. torsodecal3.Texture = "http://www.roblox.com/asset/?id=111291001"
  1776. torsodecal4 = Instance.new("Decal",v)
  1777. torsodecal4.Face = "Back"
  1778. torsodecal4.Texture = "http://www.roblox.com/asset/?id=111291001"
  1779. torsodecal5 = Instance.new("Decal",v)
  1780. torsodecal5.Face = "Right"
  1781. torsodecal5.Texture = "http://www.roblox.com/asset/?id=111291021"
  1782. torsodecal6 = Instance.new("Decal",v)
  1783. torsodecal6.Face = "Front"
  1784. torsodecal6.Texture = "http://www.roblox.com/asset/?id=111291001"
  1785. end
  1786. if headdecal6.Texture == "rbxassetid://295150002" then
  1787. torso.Size = Vector3.new(1.3, 1.95, 0.65)
  1788. lArm.Size = Vector3.new(0.58, 1.95, 0.65)
  1789. rArm.Size = Vector3.new(0.58, 1.95, 0.65)
  1790. lLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  1791. rLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  1792.  
  1793. --blockmesh1 = Instance.new("SpecialMesh", lArm)
  1794. --blockmesh1.Scale = Vector3.new(-0.7,1,1)
  1795. --blockmesh1.Offset = Vector3.new(-0.107, 0, 0)
  1796. --blockmesh2 = Instance.new("SpecialMesh", rArm)
  1797. --blockmesh2.Scale = Vector3.new(-0.7,1,1)
  1798. --blockmesh2.Offset = Vector3.new(-0.107, 0, 0)
  1799. char.Humanoid:ClearAllChildren()
  1800. --char.Animate:Remove()
  1801. char.Humanoid:ClearAllChildren()
  1802. --char.Animate:Remove()
  1803. alexshirt = Instance.new("Shirt",char)
  1804. alexshirt.ShirtTemplate = "rbxassetid://3977861054"
  1805. alexpants = Instance.new("Pants",char)
  1806. alexpants.PantsTemplate = "rbxassetid://2897639977"
  1807. for _,cM in pairs(char:GetChildren()) do
  1808. if cM.ClassName == "CharacterMesh" then cM:Destroy() end
  1809. end
  1810. lS = Instance.new("Motor6D", torso)
  1811. lS.Name = "Left Shoulder"
  1812. lS.Part0 = lArm
  1813. lS.Part1 = torso
  1814. lS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  1815. lS.C1 = CFrame.new(0.58, 0.975, 0)
  1816. char:WaitForChild("Body Colors").HeadColor = BrickColor.new("Neon orange")
  1817. head.BrickColor = BrickColor.new("Neon orange")
  1818. head.Material = "SmoothPlastic"
  1819. rS = Instance.new("Motor6D", torso)
  1820. rS.Name = "Right Shoulder"
  1821. rS.Part0 = rArm
  1822. rS.Part1 = torso
  1823. rS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  1824. rS.C1 = CFrame.new(-0.58, 0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  1825. end
  1826. coroutine.resume(coroutine.create(function()
  1827. player = game.Players.LocalPlayer
  1828. char = player.Character
  1829. billnametag = Instance.new("BillboardGui",char.Head)
  1830. billnametag.StudsOffset = Vector3.new(0,1.5,0)
  1831. billnametag.ZIndexBehavior = "Global"
  1832. billnametag.LightInfluence = 1
  1833. billnametag.MaxDistance = math.huge
  1834. billnametag.AlwaysOnTop = true
  1835. frame = Instance.new("Frame",billnametag)
  1836. frame.AnchorPoint = Vector2.new(0, 0)
  1837. frame.Size = UDim2.new(1,0,1,0)
  1838. frame.BackgroundTransparency = 1
  1839. frame.BackgroundColor3 = Color3.new(0,0,0)
  1840. frame.Position = UDim2.new(0,0,0,0)
  1841. --billnametag.PlayerToHideFrom = player
  1842. textlabel = Instance.new("TextLabel",frame)
  1843. --textlabel.BorderSizePixel = 0
  1844. textlabel.Font = "Arcade"
  1845. textlabel.Size = UDim2.new(1,0,1,0)
  1846. textlabel.Position = UDim2.new(0,1,0,1)
  1847. textlabel.Text = player.Name
  1848. textlabel.BackgroundColor3 = Color3.new(0,0,0)
  1849. textlabel.TextColor3 = Color3.fromRGB(255,255,255)
  1850. textlabel.BackgroundTransparency = 0.5
  1851. textlabel.AnchorPoint = Vector2.new(0,0)
  1852. --textlabel.ClipsDescendants = true
  1853. --textlabel.TextScaled = true
  1854. textlabel.TextSize = 20
  1855. billnametag.Size = UDim2.new(textlabel.TextBounds.X/100, 0, 0.75, 0)
  1856. frame.Size = UDim2.new(textlabel.TextBounds.X/100, 0, 0.75, 0)
  1857. billnametag.SizeOffset = Vector2.new(-textlabel.TextBounds.X/200 + 0.5, 0)
  1858. if player.Name == "DEATHANDCONFUSION" then
  1859. textlabel.TextColor3 = Color3.fromRGB(255, 255, 0)
  1860. end
  1861. if player.Name == "guest712921" then
  1862. textlabel.TextColor3 = Color3.fromRGB(255, 255, 0)
  1863. textlabel.Text = textlabel.Text.. " (BETA TESTER!!!)"
  1864. frame.Size = UDim2.new(textlabel.TextBounds.X/100, 0, 0.75, 0)
  1865. billnametag.SizeOffset = Vector2.new(-textlabel.TextBounds.X/200 + 0.5, 0)
  1866. while true do
  1867. i = 0
  1868. for n=1,0,-0.05 do
  1869. i = i + 0.05
  1870. textlabel.TextColor3 = Color3.new(i, 0, n)
  1871. wait()
  1872. end
  1873. i = 0
  1874. for n=1,0,-0.05 do
  1875. i = i + 0.05
  1876. textlabel.TextColor3 = Color3.new(n, i, 0)
  1877. wait()
  1878. end
  1879. i = 0
  1880. for n=1,0,-0.05 do
  1881. i = i + 0.05
  1882. textlabel.TextColor3 = Color3.new(0, n, i)
  1883. wait()
  1884. end
  1885. end
  1886. end
  1887. wait()
  1888. textlabel.TextScaled = true
  1889. textlabel.TextSize = 8
  1890. end))
  1891.  
  1892. -- now for the real stuff
  1893. -- |
  1894. -- |
  1895. -- V
  1896.  
  1897. local camera = workspace.Camera
  1898.  
  1899. local camPart = Instance.new("Part", camera)
  1900. camPart.Size = Vector3.new(0, 0, 0)
  1901. camPart.CFrame = camera.CFrame
  1902. camPart.CanCollide = false
  1903. camPart.Anchored = true
  1904. camPart.Transparency = 1
  1905.  
  1906. --[[local cameraHand = Instance.new("Part", camera)
  1907. cameraHand.Size = Vector3.new(0.65, 1.95, 0.65)
  1908. cameraHand.CanCollide = false
  1909. cameraHand.Anchored = true
  1910. cameraHand.Name = "CameraHand"
  1911.  
  1912. local cameraHandWeld = Instance.new("Motor6D", camPart)
  1913. cameraHandWeld.Part0 = camPart
  1914. cameraHandWeld.Part1 = cameraHand
  1915. cameraHandWeld.C0 = CFrame.new(5, 0, 0)
  1916. ]]--
  1917.  
  1918. local humanoid = char:WaitForChild("Humanoid")
  1919.  
  1920. -- Heart bar
  1921. local hpFrame = makeSquare(UDim2.new(0.5, -166, 1, -130), UDim2.new(0, 162, 0, 18),
  1922. Color3.new(0/255, 0/255, 0/255), 1, gui, 1)
  1923.  
  1924. local hearts = makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 162, 0, 18),
  1925. Color3.new(0/255, 0/255, 0/255), 1, hpFrame, 1)
  1926. hearts.ClipsDescendants = true
  1927.  
  1928. for i = 1, 10 do
  1929. local heartImg = makeImage(UDim2.new(0, (i-1)*16, 0, 0), UDim2.new(0, 18, 0, 18),
  1930. "rbxassetid://1494233443", hearts, 2)
  1931.  
  1932. makeSquare(UDim2.new(0, 4, 0, 4), UDim2.new(0, 2, 0, 2),
  1933. Color3.new(255/255, 200/255, 200/255), 0, heartImg, 2)
  1934.  
  1935. heartImg.ImageColor3 = Color3.new(240/255, 0, 0)
  1936.  
  1937. local emptyHeart = makeImage(UDim2.new(0, (i-1)*16, 0, 0), UDim2.new(0, 18, 0, 18),
  1938. "rbxassetid://1494233443", hpFrame, 1)
  1939. emptyHeart.ImageColor3 = Color3.new(0.3, 0.3, 0.3)
  1940.  
  1941. local outline = makeImage(UDim2.new(0, 0, 0, 0), UDim2.new(0, 18, 0, 18),
  1942. "rbxassetid://1494176679", emptyHeart, 1)
  1943. outline.ImageColor3 = Color3.new(0, 0, 0)
  1944.  
  1945. local oldHP = humanoid.Health/humanoid.MaxHealth --SnapToGrid((humanoid.Health/humanoid.MaxHealth)*162, 8)
  1946. humanoid.Changed:connect(function()
  1947. local hp = humanoid.Health/humanoid.MaxHealth --SnapToGrid((humanoid.Health/humanoid.MaxHealth)*162, 8)
  1948. if SnapToGrid(oldHP*162, 8) < SnapToGrid(hp*162, 8) then
  1949. outline.ImageColor3 = Color3.new(1, 1, 1)
  1950. wait(0.1)
  1951. outline.ImageColor3 = Color3.new(0, 0, 0)
  1952. wait(0.1)
  1953. end
  1954. if oldHP > hp then
  1955. for i = 1, 2 do
  1956. outline.ImageColor3 = Color3.new(1, 1, 1)
  1957. wait(0.1)
  1958. outline.ImageColor3 = Color3.new(0, 0, 0)
  1959. wait(0.1)
  1960. end
  1961. end
  1962. oldHP = hp
  1963. end)
  1964. coroutine.resume(coroutine.create(function()
  1965. local yIncrease = 0
  1966. local originalY = emptyHeart.Position.Y.Offset
  1967.  
  1968. while wait() do
  1969. if humanoid.Health/humanoid.MaxHealth <= 0.27 then
  1970. if yIncrease <= 0 then
  1971. yIncrease = math.random(1, 2)
  1972. else
  1973. yIncrease = yIncrease - 1
  1974. end
  1975.  
  1976. heartImg.Position = UDim2.new(0, heartImg.Position.X.Offset, 0, -yIncrease)
  1977. emptyHeart.Position = UDim2.new(0, emptyHeart.Position.X.Offset, 0, -yIncrease)
  1978. else
  1979. if yIncrease >= 1 then
  1980. yIncrease = yIncrease - 1
  1981.  
  1982. heartImg.Position = UDim2.new(0, heartImg.Position.X.Offset, 0, -yIncrease)
  1983. emptyHeart.Position = UDim2.new(0, emptyHeart.Position.X.Offset, 0, -yIncrease)
  1984. end
  1985. end
  1986. end
  1987. end))
  1988. end
  1989.  
  1990.  
  1991. humanoid.BreakJointsOnDeath = false
  1992. humanoid.HipHeight = 0.3
  1993.  
  1994. local rootJoint = Instance.new("Motor6D", torso)
  1995. rootJoint.Name = "RootJoint"
  1996. rootJoint.Part0 = humRootPart
  1997. rootJoint.Part1 = torso
  1998. rootJoint.C1 = CFrame.new(0, 0.05, 0)
  1999.  
  2000. local neck = Instance.new("Motor6D", torso)
  2001. neck.Name = "Neck"
  2002. neck.Part0 = head
  2003. neck.Part1 = torso
  2004.  
  2005. local lH = Instance.new("Motor6D", torso)
  2006. lH.Name = "Left Hip"
  2007. lH.Part0 = lLeg
  2008. lH.Part1 = torso
  2009. lH.C0 = CFrame.new(0, 0.975, 0)
  2010. lH.C1 = CFrame.new(0.325, -0.975, 0) * CFrame.Angles(0, 0, 0)
  2011.  
  2012. local rH = Instance.new("Motor6D", torso)
  2013. rH.Name = "Right Hip"
  2014. rH.Part0 = rLeg
  2015. rH.Part1 = torso
  2016. rH.C0 = CFrame.new(0, 0.975, 0)
  2017. rH.C1 = CFrame.new(-0.325, -0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  2018.  
  2019. for _,p in pairs(char:GetChildren()) do
  2020. if p.ClassName == "Part" and p.Name ~= "DamagePart" and p.Name ~= "HandItem" and p.Name ~= "HumanoidRootPart" then
  2021. local hit = Instance.new("Part", char)
  2022. hit.Name = "DamagePart"
  2023. hit.BrickColor = BrickColor.new("Bright red")
  2024. hit.Material = "SmoothPlastic"
  2025. hit.Transparency = 1
  2026. hit.Size = Vector3.new(p.Size.X + 0.001, p.Size.Y + 0.001, p.Size.Z + 0.001)
  2027. hit.CanCollide = false
  2028. weldTo(hit, p)
  2029. end
  2030. end
  2031.  
  2032. local ticks = 0
  2033. local times = 0
  2034.  
  2035. local walkAnim = 0
  2036. local increaseWalkAnim = 1
  2037.  
  2038. local idleAnimRotX = 0
  2039. local idleAnimRotZ = 0
  2040. local sneaking = 0
  2041.  
  2042. local Mouse = player:GetMouse()
  2043.  
  2044.  
  2045. local oldHP = humanoid.Health
  2046.  
  2047. local damageTime = 0
  2048. neededtopunch = false
  2049. punchdelay = false
  2050. local punchRotX = 0
  2051. local punchRotY = 0
  2052. local punchRotZ = 0
  2053. local punchSpeed = 0
  2054. local punching = 0
  2055. local selectedBlock = 0
  2056. local punchEnded = 1
  2057. local itemOnHand = nil
  2058. local selectBox = Instance.new("SelectionBox", char)
  2059. selectBox.Adornee = nil
  2060. selectBox.Transparency = 0.5
  2061. selectBox.Color3 = Color3.new(0, 0, 0)
  2062. selectBox.LineThickness = 0
  2063.  
  2064. local handItem = Instance.new("Part", char)
  2065. handItem.Name = "HandItem"
  2066. handItem.Size = Vector3.new(0.52, 0.52, 0.52)
  2067. handItem.Transparency = 1
  2068. handItem.CanCollide = false
  2069.  
  2070. local handItemWeld = Instance.new("Weld", char)
  2071. handItemWeld.Part0 = handItem
  2072. handItemWeld.Part1 = lArm
  2073. handItemWeld.C1 = CFrame.new(0, -0.9, -0.6) * CFrame.Angles(math.rad(-10), math.rad(45), 0)
  2074.  
  2075. local sound = Instance.new("Sound", char)
  2076. sound.Name = "Hurt"
  2077. sound.Volume = 10
  2078. sound.SoundId = "rbxassetid://3362346832"
  2079. if humanoid.Health < oldHP then
  2080. damageTime = 60
  2081. sound:Play()
  2082. end
  2083. reallyispunching = false
  2084. breakingblock = false
  2085. local facesToResize = {"Front", "Back", "Left", "Right", "Bottom", "Top"}
  2086. Mouse.Button1Down:connect(function()
  2087. neededtopunch = true
  2088. reallyispunching = true
  2089. if Mouse.Target and reallyispunching == true then
  2090. if getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  2091. if Mouse.Target.Name ~= "Baseplate" and Mouse.Target.Name ~= "Debris" and Mouse.Target.Name ~= "Base" then
  2092. local humanoid = Mouse.Target.Parent:FindFirstChildOfClass("Humanoid")
  2093. if humanoid then
  2094. humanoid.Health = humanoid.Health - 10
  2095. local parts = Mouse.Target.Parent:GetChildren()
  2096. for _,p in pairs(parts) do
  2097. if p.ClassName == "Part" then
  2098. p.Velocity = Vector3.new(p.Velocity.X + (head.CFrame.lookVector.X * 18), p.Velocity.Y + (head.CFrame.lookVector.Y * 18) + 8, p.Velocity.Z + (head.CFrame.lookVector.Z * 18))
  2099. end
  2100. end
  2101. return
  2102. end
  2103. local blkTar = Mouse.Target
  2104. if blkTar then
  2105. breakingblock = true
  2106. if not workspace:FindFirstChild("BlockCrack") then
  2107. blkTarCrack = Instance.new("Part",workspace)
  2108. blkTarCrack.Name = "BlockCrack"
  2109. blkTarCrack.Transparency = 1
  2110. blkTarCrack.CanCollide = false
  2111. blkTarCrack.Size = blkTar.Size + Vector3.new(0.005,0.005,0.005)
  2112. local blkTarCrackWeld = Instance.new("Weld",blkTarCrack)
  2113. blkTarCrackWeld.Part0 = blkTar
  2114. blkTarCrackWeld.Part1 = blkTarCrack
  2115. end
  2116. coroutine.resume(coroutine.create(function()
  2117. while wait() do
  2118. if breakingblock == false then
  2119. blkTarCrack:Destroy()
  2120. end
  2121. end
  2122. end))
  2123. crack1 = Instance.new("Texture",blkTarCrack)
  2124. crack1.Face = "Left"
  2125. crack1.Texture = "http://www.roblox.com/asset/?id=448916163"
  2126. crack1.Name = "crack"
  2127. crack1.Color3 = Color3.new(0,0,0)
  2128. crack1.StudsPerTileV= 2.605
  2129. crack1.StudsPerTileU= 2.605
  2130. crack2 = Instance.new("Texture",blkTarCrack)
  2131. crack2.Face = "Bottom"
  2132. crack2.Texture = "http://www.roblox.com/asset/?id=448916163"
  2133. crack2.Name = "crack"
  2134. crack2.Color3 = Color3.new(0,0,0)
  2135. crack2.StudsPerTileV= 2.605
  2136. crack2.StudsPerTileU= 2.605
  2137. crack3 = Instance.new("Texture",blkTarCrack)
  2138. crack3.Face = "Top"
  2139. crack3.Texture = "http://www.roblox.com/asset/?id=448916163"
  2140. crack3.Name = "crack"
  2141. crack3.Color3 = Color3.new(0,0,0)
  2142. crack3.StudsPerTileV= 2.605
  2143. crack3.StudsPerTileU= 2.605
  2144. crack4 = Instance.new("Texture",blkTarCrack)
  2145. crack4.Face = "Back"
  2146. crack4.Texture = "http://www.roblox.com/asset/?id=448916163"
  2147. crack4.Name = "crack"
  2148. crack4.Color3 = Color3.new(0,0,0)
  2149. crack4.StudsPerTileV= 2.605
  2150. crack4.StudsPerTileU= 2.605
  2151. crack5 = Instance.new("Texture",blkTarCrack)
  2152. crack5.Face = "Right"
  2153. crack5.Texture = "http://www.roblox.com/asset/?id=448916163"
  2154. crack5.Name = "crack"
  2155. crack5.StudsPerTileV= 2.605
  2156. crack5.StudsPerTileU= 2.605
  2157. crack5.Color3 = Color3.new(0,0,0)
  2158. crack6 = Instance.new("Texture",blkTarCrack)
  2159. crack6.Face = "Front"
  2160. crack6.Texture = "http://www.roblox.com/asset/?id=448916163"
  2161. crack6.Name = "crack"
  2162. crack6.Color3 = Color3.new(0,0,0)
  2163. crack6.StudsPerTileV= 2.605
  2164. crack6.StudsPerTileU= 2.605
  2165. if breakingblock == false then
  2166. blkTarCrack:Destroy()
  2167. end
  2168. for i,v in pairs(blkTarCrack:GetChildren()) do
  2169. if v.Name == "crack" then
  2170. v.Texture = "rbxassetid://448916452"
  2171. end
  2172. end
  2173. wait(0.7)
  2174. for i,v in pairs(blkTarCrack:GetChildren()) do
  2175. if v.Name == "crack" then
  2176. v.Texture = "rbxassetid://448916989"
  2177. end
  2178. end
  2179. wait(0.7)
  2180. for i,v in pairs(blkTarCrack:GetChildren()) do
  2181. if v.Name == "crack" then
  2182. v.Texture = "rbxassetid://448917080"
  2183. end
  2184. end
  2185. if breakingblock == true and blkTarCrack then
  2186. wait(0.7)
  2187. blkTar:Destroy()
  2188. blkTarCrack.Parent = nil
  2189. for i,v in pairs(blkTarCrack:GetChildren()) do
  2190. v:Destroy()
  2191. end
  2192. for i = 1, 9 do
  2193. local part = Instance.new("Part", workspace)
  2194. part.Size = Vector3.new(0, 0, 0)
  2195. part.Transparency = 1
  2196. part.CanCollide = false
  2197. part.Velocity = Vector3.new(math.random(-5, 5), 5, math.random(-5, 5))
  2198. part.Name = "Debris"
  2199.  
  2200. part.CFrame =
  2201. Mouse.Target.CFrame *
  2202. CFrame.new(math.random(-blkTar.Size.X/2, blkTar.Size.X/2), math.random(-blkTar.Size.Y/2, blkTar.Size.Y/2), math.random(-blkTar.Size.Z/2, blkTar.Size.Z/2))
  2203.  
  2204. part.CustomPhysicalProperties = PhysicalProperties.new(0, 0.2, 0, 100, 100)
  2205.  
  2206. local billboard = Instance.new("BillboardGui", part)
  2207. billboard.Size = UDim2.new(1.2, 0, 1.2, 0)
  2208.  
  2209. local clipDescendant = Instance.new("TextLabel", billboard)
  2210. clipDescendant.Size = UDim2.new(0.5, 0, 0.5, 0)
  2211. clipDescendant.BackgroundTransparency = 1
  2212. clipDescendant.Text = ""
  2213. clipDescendant.ClipsDescendants = true
  2214.  
  2215. local img = Instance.new("ImageLabel", clipDescendant)
  2216. img.Size = UDim2.new(2, 0, 2, 0)
  2217. img.BackgroundTransparency = 1
  2218. img.Position = UDim2.new(math.random(-70, 70)/100, 0, math.random(-70, 70)/100, 0)
  2219.  
  2220. local tex = blkTar:FindFirstChild("Front")
  2221. if tex then
  2222. img.Image = tex.Texture
  2223. else
  2224. img.Image = "rbxassetid://744949545"
  2225. end
  2226.  
  2227. if img.Image == "rbxassetid://744949545" then
  2228. img.ImageColor3 = blkTar.Color
  2229. end
  2230.  
  2231. part.Touched:connect(function(prt)
  2232. if prt ~= blkTar then
  2233. part.CanCollide = true
  2234. end
  2235. end)
  2236.  
  2237. coroutine.resume(coroutine.create(function()
  2238. wait(math.random(50, 65)/100)
  2239. part:Destroy()
  2240. end))
  2241. --part.Anchored = false
  2242. end
  2243. end
  2244.  
  2245. while wait() do
  2246. if breakingblock == false then
  2247. blkTarCrack:Destroy()
  2248. end
  2249. end
  2250. end
  2251.  
  2252. local humanoid = Mouse.Target.Parent:FindFirstChild("Humanoid")
  2253. if humanoid then
  2254. humanoid.Health = humanoid.Health - 35
  2255. humanoid.Health:TakeDamage(35)
  2256. local parts = Mouse.Target.Parent:GetChildren()
  2257. for _,p in pairs(parts) do
  2258. if p.ClassName == "Part" then
  2259. p.Velocity = Vector3.new(p.Velocity.X + (head.CFrame.lookVector.X * 18), p.Velocity.Y + (head.CFrame.lookVector.Y * 18) + 8, p.Velocity.Z + (head.CFrame.lookVector.Z * 18))
  2260. end
  2261. end
  2262. return
  2263. end
  2264. local x = Mouse.Target.CFrame.p.X
  2265. local y = Mouse.Target.CFrame.p.Y
  2266. local z = Mouse.Target.CFrame.p.Z
  2267. if Mouse.TargetSurface.Name == "Right" then x = x + 2.6 end
  2268. if Mouse.TargetSurface.Name == "Left" then x = x - 2.6 end
  2269. if Mouse.TargetSurface.Name == "Top" then y = y + 2.6 end
  2270. if Mouse.TargetSurface.Name == "Bottom" then y = y - 2.6 end
  2271. if Mouse.TargetSurface.Name == "Back" then z = z + 2.6 end
  2272. if Mouse.TargetSurface.Name == "Front" then z = z - 2.6 end
  2273. if Mouse.Target.Size.X > 2.6 or Mouse.Target.Size.Y > 2.6 or Mouse.Target.Size.Z > 2.6 then
  2274. x = Mouse.Hit.p.X
  2275. y = Mouse.Hit.p.Y
  2276. z = Mouse.Hit.p.Z
  2277. end
  2278. -- local x = round(math.abs(mouseX)/2.6)*2.6
  2279. -- local y = round(math.abs(mouseY)/2.6)*2.6
  2280. -- local z = round(math.abs(mouseZ)/2.6)*2.6
  2281. -- if Mouse.Hit.p.X < 0 then x = x * -1 end
  2282. -- if Mouse.Hit.p.Y < 0 then y = y * -1 end
  2283. -- if Mouse.Hit.p.Z < 0 then z = z * -1 end
  2284. end
  2285. end
  2286. end
  2287. end)
  2288. Mouse.Button1Up:connect(function()
  2289. reallyispunching = false
  2290. breakingblock = false
  2291. neededtopunch = false
  2292. end)
  2293. function placeBlock(block, cFPos)
  2294. local blockPlaced = Instance.new("Part", workspace)
  2295. blockPlaced.Material = "Fabric"
  2296. blockPlaced.Anchored = false
  2297. blockPlaced.Size = block.size
  2298. blockPlaced.CFrame = cFPos
  2299. local blockvalue = Instance.new("BoolValue",blockPlaced)
  2300. blockvalue.Name = "IsBlock"
  2301. blockvalue.Value = true
  2302. if block.hasGravity == true then
  2303. local connectedTo = Instance.new("ObjectValue", blockPlaced)
  2304. connectedTo.Name = "ConnectedTo"
  2305. blockPlaced.Anchored = false
  2306. blockPlaced.CanCollide = false
  2307. local detector = Instance.new("Part", workspace:WaitForChild("Camera"))
  2308. detector.Transparency = 1
  2309. detector.CanCollide = false
  2310. detector.Size = Vector3.new(1, 0, 1)
  2311. local weldDetector = Instance.new("Motor6D", detector)
  2312. weldDetector.Part0 = detector
  2313. weldDetector.Part1 = blockPlaced
  2314. weldDetector.C1 = CFrame.new(0, -blockPlaced.Size.Y/2, 0)
  2315. local landed = false
  2316. local function fallingBlock()
  2317. coroutine.resume(coroutine.create(function()
  2318. local falling = blockPlaced:FindFirstChild("IsFalling") or Instance.new("CFrameValue", blockPlaced)
  2319. falling.Name = "IsFalling"
  2320. local grav = 0
  2321. while RS:wait() do
  2322. if landed then falling:Destroy() break end
  2323. grav = math.max(-1, grav - 0.0025)
  2324. --blockPlaced.CFrame = CFrame.new(cFPos.X, blockPlaced.CFrame.Y + grav, cFPos.Z)
  2325. end
  2326. end))
  2327. end
  2328. fallingBlock()
  2329. detector.Touched:connect(function(part)
  2330. if blockPlaced.Anchored == false and part ~= blockPlaced and part.Name ~= "Debris" and part:FindFirstChild("IsFalling") == nil and findHumanoid(part) == nil then
  2331. landed = true
  2332. blockPlaced.CanCollide = true
  2333. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  2334. blockPlaced.Anchored = true
  2335. connectedTo.Value = part
  2336. local yOrigin = part.CFrame.Y + (blockPlaced.Size.Y/2) + (part.Size.Y/2)
  2337. blockPlaced.CFrame = CFrame.new(cFPos.X, yOrigin, cFPos.Z)
  2338. --detector:Destroy()
  2339. local falling = false
  2340. part.Changed:connect(function()
  2341. if part.Position.Y ~= yOrigin and falling == false then
  2342. falling = true
  2343. wait(0.075)
  2344. landed = false
  2345. blockPlaced.Anchored = false
  2346. blockPlaced.CanCollide = false
  2347. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  2348. fallingBlock()
  2349. falling = false
  2350. end
  2351. end)
  2352. workspace.ChildRemoved:connect(function()
  2353. --print("hi")
  2354. if connectedTo.Value.Parent == nil and falling == false then
  2355. falling = true
  2356. landed = false
  2357. blockPlaced.Anchored = false
  2358. blockPlaced.CanCollide = false
  2359. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  2360. fallingBlock()
  2361. end
  2362. end)
  2363. end
  2364. end)
  2365. end
  2366. putTexture(blockPlaced, block.frontTex, block.backTex,
  2367. block.topTex, block.bottomTex, block.leftTex, block.rightTex, "Texture")
  2368. local blockSound = Instance.new("Sound", blockPlaced)
  2369. blockSound.SoundId = block.sound
  2370. blockSound.Volume = block.soundVol
  2371. blockSound.Pitch = math.random(95, 105)/100
  2372. blockSound.PlayOnRemove = true
  2373. blockSound:Play()
  2374. return blockPlaced
  2375. end
  2376. Mouse.KeyDown:Connect(function(key)
  2377. if key == "b" then
  2378. if not workspace:FindFirstChild("Blocks") then
  2379. local folder = Instance.new("Folder",workspace)
  2380. folder.Name = "Blocks"
  2381. end
  2382. if punchEnded == 1 then punching = 1 end
  2383. if getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  2384. local x = Mouse.Hit.p.X
  2385. local y = Mouse.Hit.p.Y
  2386. local z = Mouse.Hit.p.Z
  2387. local blk = placeBlock(toolBar[selectedBlock + 1], CFrame.new(x, y, z))
  2388. blk.Parent = workspace:WaitForChild("Blocks")
  2389. for _,f in pairs(facesToResize) do
  2390. blk:WaitForChild(f).StudsPerTileU = 2.6
  2391. blk:WaitForChild(f).StudsPerTileV = 2.6
  2392. end
  2393. wait(0.00)
  2394. blk.Anchored = true
  2395. blk.CFrame = CFrame.new(SnapToGrid(blk.CFrame.X, 2.6), SnapToGrid(blk.CFrame.Y, 2.6), SnapToGrid(blk.CFrame.Z, 2.6))
  2396. end
  2397. end
  2398. end)
  2399.  
  2400. local changedItem = false
  2401. local hasItemOnHand = 0
  2402. local hi = 0
  2403. -- selection thingy
  2404. local selectLabel = Instance.new("TextLabel", gui)
  2405. selectLabel.Size = UDim2.new(0, 32, 0, 32)
  2406. selectLabel.Position = UDim2.new(0.5, -160 + (selectedBlock*40), 1, -105)
  2407. selectLabel.BackgroundTransparency = 1
  2408. selectLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  2409. selectLabel.BorderSizePixel = 0
  2410. selectLabel.Text = ""
  2411. selectLabel.ZIndex = 3
  2412. makeSquare(UDim2.new(0, -2, 0, 0), UDim2.new(0, 2, 0, 32),
  2413. Color3.new(88/255, 102/255, 85/255), 0, selectLabel, 3)
  2414. makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 32, 0, 2),
  2415. Color3.new(88/255, 102/255, 85/255), 0, selectLabel, 3)
  2416. makeSquare(UDim2.new(0, -2, 0, 32), UDim2.new(0, 36, 0, 2),
  2417. Color3.new(212/255, 231/255, 207/255), 0, selectLabel, 3)
  2418. makeSquare(UDim2.new(0, 32, 0, 0), UDim2.new(0, 2, 0, 32),
  2419. Color3.new(212/255, 231/255, 207/255), 0, selectLabel, 3)
  2420. makeSquare(UDim2.new(0, 34, 0, -4), UDim2.new(0, 2, 0, 40),
  2421. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  2422. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 2, 0, 40),
  2423. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  2424. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 40, 0, 2),
  2425. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  2426. makeSquare(UDim2.new(0, 32, 0, -2), UDim2.new(0, 2, 0, 2),
  2427. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  2428. makeSquare(UDim2.new(0, -4, 0, 34), UDim2.new(0, 40, 0, 2),
  2429. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  2430. makeSquare(UDim2.new(0, -6, 0, -6), UDim2.new(0, 2, 0, 42),
  2431. Color3.new(212/255, 231/255, 207/255), 0, selectLabel, 3)
  2432. makeSquare(UDim2.new(0, -6, 0, -6), UDim2.new(0, 42, 0, 2),
  2433. Color3.new(212/255, 231/255, 207/255), 0, selectLabel, 3)
  2434. makeSquare(UDim2.new(0, 36, 0, -4), UDim2.new(0, 2, 0, 40),
  2435. Color3.new(88/255, 102/255, 85/255), 0, selectLabel, 3)
  2436. makeSquare(UDim2.new(0, 36, 0, -6), UDim2.new(0, 2, 0, 2),
  2437. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  2438. makeSquare(UDim2.new(0, 38, 0, -6), UDim2.new(0, 2, 0, 44),
  2439. Color3.new(0/255, 0/255, 0/255), 0.3, selectLabel, 3)
  2440. makeSquare(UDim2.new(0, -8, 0, -6), UDim2.new(0, 2, 0, 44),
  2441. Color3.new(0/255, 0/255, 0/255), 0.3, selectLabel, 3)
  2442. makeSquare(UDim2.new(0, -8, 0, -8), UDim2.new(0, 48, 0, 2),
  2443. Color3.new(0/255, 0/255, 0/255), 0, selectLabel, 3)
  2444. --
  2445. Mouse.KeyDown:connect(function(key)
  2446. if key == "q" then
  2447. sneaking = 1
  2448. humanoid.WalkSpeed = humanoid.WalkSpeed / 2
  2449. rootJoint.C1 = CFrame.Angles(math.rad(sneaking*25), 0, 0)
  2450. neck.C1 = CFrame.Angles(-math.rad(torso.Orientation.X - (sneaking*25)), 0, 0)
  2451. lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*25), 0, 0)
  2452. rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*25), 0, 0)
  2453. --print("Sneaking...")
  2454. end
  2455. if key == "r" then
  2456. if creativeInventoryGUI.Visible == true then
  2457. creativeInventoryGUI.Visible = false
  2458. elseif creativeInventoryGUI.Visible == false then
  2459. creativeInventoryGUI.Visible = true
  2460. end
  2461. end
  2462. if key == "e" then
  2463. if selectedBlock == 8 then
  2464. selectedBlock = -1
  2465. end
  2466. selectedBlock = selectedBlock + 1
  2467. itemOnHand = toolBar[selectedBlock + 1]
  2468. if selectedBlock < 7 then
  2469. for _,d in pairs(handItem:GetChildren()) do
  2470. d:Destroy()
  2471. end
  2472. putTexture(handItem, itemOnHand.frontTex, itemOnHand.backTex,
  2473. itemOnHand.topTex, itemOnHand.bottomTex,
  2474. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  2475. for _,f in pairs(facesToResize) do
  2476. handItem:WaitForChild(f).StudsPerTileU = 0.52
  2477. handItem:WaitForChild(f).StudsPerTileV = 0.52
  2478. end
  2479. elseif selectedBlock > 7 then
  2480. for _,d in pairs(handItem:GetChildren()) do
  2481. d:Destroy()
  2482. end
  2483. if hasItemOnHand == 1 then hi = 1 end
  2484. end
  2485. end
  2486. end)
  2487. Mouse.KeyDown:connect(function(key)
  2488. if (key == "0" or key == "1" or key == "2"
  2489. or key == "3" or key == "4" or key == "5"
  2490. or key == "6" or key == "7") and hasItemOnHand == 0 then hi = 1 end
  2491. selectLabel.Position = UDim2.new(0.5, -160 + ((selectedBlock)*40), 1, -105)
  2492. end)
  2493.  
  2494.  
  2495. Mouse.KeyUp:connect(function(key)
  2496. if key == "q" then
  2497. sneaking = 0
  2498. humanoid.WalkSpeed = humanoid.WalkSpeed * 2
  2499. humanoid.HipHeight = 0.3
  2500. rootJoint.C1 = CFrame.new(0, 0.05, 0) * CFrame.Angles(0, 0, 0)
  2501. lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(0, 0, 0)
  2502. rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(0, 0, 0)
  2503. --print("Stopped sneaking...")
  2504. end
  2505. end)
  2506. dead = false
  2507. local humOffset = CFrame.new(0, 0, 0)
  2508. while RS:wait() do
  2509. if neededtopunch == true then
  2510. if punchEnded == 1 then punching = 1 end
  2511. end
  2512. hearts.Size = UDim2.new(0, SnapToGrid((humanoid.Health/humanoid.MaxHealth)*162, 8) + 2, 0, 18)
  2513. if itemOnHand ~= nil then
  2514. hasItemOnHand = 1
  2515. handItem.Transparency = 0
  2516. else
  2517. hasItemOnHand = 0
  2518. handItem.Transparency = 1
  2519. end
  2520. if humanoid.Health < oldHP then
  2521. damageTime = 60
  2522. sound:Play()
  2523. end
  2524. oldHP = humanoid.Health
  2525. if damageTime > 0 and humanoid.Health > 0 then
  2526. for _,p in pairs(char:GetChildren()) do
  2527. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  2528. if p.Name == "DamagePart" then
  2529. p.Transparency = 0.5
  2530. end
  2531. end
  2532. end
  2533. damageTime = damageTime - 2
  2534. if damageTime <= 0 then
  2535. for _,p in pairs(char:GetChildren()) do
  2536. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  2537. if p.Name == "DamagePart" then
  2538. p.Transparency = 1
  2539. end
  2540. end
  2541. end
  2542. end
  2543. end
  2544. function updateItemOnHand()
  2545. for _,d in pairs(handItem:GetChildren()) do
  2546. d:Destroy()
  2547. end
  2548.  
  2549. if oldItemOnHand ~= itemOnHand then
  2550. changedItem = true
  2551. end
  2552. end
  2553. if updateHand == true then
  2554. updateHand = false
  2555. updateItemOnHand()
  2556. if oldItemOnHand ~= itemOnHand then
  2557. changedItem = true
  2558. end
  2559. end
  2560. local pressedWTimes = 0
  2561. local sprintingNum = 0
  2562. local sprinting = false
  2563. Mouse.KeyDown:connect(function(key)
  2564. if sprinting == false then sprintingNum = 0 else sprintingNum = 1 end
  2565. if (key == "w" and sprinting == false and sneaking == 0) then
  2566. if pressedWTimes >= 1 or key == Enum.KeyCode.LeftControl then
  2567. sprinting = true
  2568. humanoid.WalkSpeed = 25
  2569. pressedWTimes = 0
  2570. end
  2571. pressedWTimes = pressedWTimes + 1
  2572. coroutine.resume(coroutine.create(function()
  2573. for i = 1, 9 do
  2574. if sprinting == true then break end
  2575. wait()
  2576. end
  2577. pressedWTimes = 0
  2578. end))
  2579. end
  2580. end)
  2581. Mouse.KeyUp:connect(function(key)
  2582. if sprinting == false then sprintingNum = 0 else sprintingNum = 1 end
  2583. if (key == "w" and sprinting == true and sneaking == 0) then
  2584. sprinting = false
  2585. humanoid.WalkSpeed = 16
  2586. end
  2587. end)
  2588. Mouse.KeyUp:connect(function(key)
  2589. if key == "w" and sprinting == true and sneaking == 0 then
  2590. sprinting = false
  2591. humanoid.WalkSpeed = 16
  2592. pressedWTimes = 0
  2593. end
  2594. end)
  2595. Mouse.KeyDown:connect(function(key)
  2596. if key == "1" or key == "2" or key == "3" or
  2597. key == "4" or key == "5" or key == "6" or
  2598. key == "7" or key == "8" or key == "9" then
  2599. selectedBlock = tonumber(key) - 1
  2600. oldItemOnHand = itemOnHand
  2601. itemOnHand = toolBar[tonumber(key)]
  2602. updateItemOnHand()
  2603. if hasItemOnHand == 0 and itemOnHand then hi = 1 end
  2604. if hasItemOnHand == 1 and itemOnHand == nil then hi = 1 end
  2605. end
  2606. --if (key == "0" or key == "1" or key == "2"
  2607. -- or key == "3" or key == "4" or key == "5"
  2608. -- or key == "6" or key == "7") and hasItemOnHand == 0 then hi = 1 end
  2609. selectLabel.Position = UDim2.new(0.5, -160 + ((selectedBlock)*40), 1, -105)
  2610. end)
  2611. humanoid.Died:connect(function()
  2612. --[[
  2613. char.Parent = game.Lighting
  2614. local DeathGui = Instance.new("ScreenGui",player.PlayerGui)
  2615. DeathGui.Name = "DeathScreen"
  2616. local DeathFrame0 = Instance.new("Frame",DeathGui)
  2617. DeathFrame0.BackgroundColor3 = Color3.fromRGB(170, 0, 0)
  2618. DeathFrame0.BackgroundTransparency = 0.6
  2619. DeathFrame0.Position = UDim2.new(0, 0,0, 0)
  2620. DeathFrame0.Size = UDim2.new(1, 0,1, 0)
  2621. local DeathFrame1 = Instance.new("Frame",DeathGui)
  2622. DeathFrame1.BackgroundColor3 = Color3.fromRGB(170, 0, 0)
  2623. DeathFrame1.BackgroundTransparency = 1
  2624. DeathFrame1.Position = UDim2.new(0, 1,0, 250)
  2625. DeathFrame1.Size = UDim2.new(1, 0,0.1, 0)
  2626. local YouDiedTitle = Instance.new("TextLabel",DeathFrame1)
  2627. YouDiedTitle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  2628. YouDiedTitle.BackgroundTransparency = 1
  2629. YouDiedTitle.Size = UDim2.new(0, 200,0, 50)
  2630. YouDiedTitle.Position = UDim2.new(0.398, 0,-2.058, 0)
  2631. YouDiedTitle.Font = "Arcade"
  2632. YouDiedTitle.Text = "You Died!"
  2633. YouDiedTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  2634. YouDiedTitle.TextSize = 92
  2635. local RespawnButton = Instance.new("TextButton",DeathFrame1)
  2636. RespawnButton.BackgroundColor3 = Color3.fromRGB(128, 128, 128)
  2637. RespawnButton.BackgroundTransparency = 0
  2638. RespawnButton.Size = UDim2.new(0, 400,0, 50)
  2639. RespawnButton.Position = UDim2.new(0.3, 0,1.494, 0)
  2640. RespawnButton.Font = "Arcade"
  2641. RespawnButton.Text = "Respawn"
  2642. RespawnButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  2643. RespawnButton.TextSize = 48
  2644. local TitleScreenButton = Instance.new("TextButton",DeathFrame1)
  2645. TitleScreenButton.BackgroundColor3 = Color3.fromRGB(128, 128, 128)
  2646. TitleScreenButton.BackgroundTransparency = 0
  2647. TitleScreenButton.Size = UDim2.new(0, 400,0, 50)
  2648. TitleScreenButton.Position = UDim2.new(0.3, 0,3.242, 0)
  2649. TitleScreenButton.Font = "Arcade"
  2650. TitleScreenButton.Text = "Title Screen"
  2651. TitleScreenButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  2652. TitleScreenButton.TextSize = 48
  2653. RespawnButton.MouseButton1Click:Connect(function(plr)
  2654. plr:LoadCharacter()
  2655. end)
  2656. TitleScreenButton.MouseButton1Click:Connect(function(plr)
  2657. plr.PlayerGui:Destroy()
  2658. plr.Character:Destroy()
  2659. end)
  2660. char:MakeJoints()
  2661. humanoid.Health = 100
  2662. char.Parent = game.Lighting
  2663. --]]
  2664. end)
  2665. if humanoid.Health < 1 and dead == false then
  2666. dead = true
  2667.  
  2668. coroutine.resume(coroutine.create(function()
  2669. local corpseCF = humRootPart.CFrame + Vector3.new(0, -2.925, 0)
  2670. local corpse = Instance.new("Part", workspace)
  2671. corpse.Anchored = true
  2672. corpse.Name = "Dead Corpse"
  2673. target = char
  2674. target.Archivable = true
  2675. playercorpse = target:Clone()
  2676. playercorpse.Parent = corpse
  2677. corpse.Size = Vector3.new(3, 1, 3)
  2678. corpse.CFrame = corpseCF
  2679. corpse.Transparency = 1
  2680. corpse.CustomPhysicalProperties = PhysicalProperties.new(1, 1, 0, 1, 1)
  2681.  
  2682. local dHead = playercorpse.Head
  2683. dHead.CanCollide = false
  2684. --dHead.Material = "Fabric"
  2685.  
  2686. local dTorso = playercorpse.Torso
  2687. dTorso.CanCollide = false
  2688.  
  2689. local dLArm = playercorpse["Left Arm"]
  2690. dLArm.CanCollide = false
  2691.  
  2692. local dRArm = playercorpse["Right Arm"]
  2693. dRArm.CanCollide = false
  2694.  
  2695. local dLLeg = playercorpse["Right Leg"]
  2696. dLLeg.CanCollide = false
  2697.  
  2698. local dRLeg = playercorpse["Right Leg"]
  2699. dRLeg.CanCollide = false
  2700. weldCorpse = Instance.new("Weld",corpse)
  2701. weldCorpse.Part0 = dTorso
  2702. weldCorpse.Part1 = corpse
  2703. weldCorpse.C0 = CFrame.new(0, -1.95 - 0.4, 0)
  2704.  
  2705. -- lazy naming...
  2706.  
  2707. for _,p in pairs(playercorpse:GetChildren()) do
  2708. if p.Name == "DamagePart" then
  2709. p.Transparency = 0.5
  2710. end
  2711. end
  2712.  
  2713. head.Parent = nil
  2714. torso.Parent = nil
  2715. lArm.Parent = nil
  2716. rArm.Parent = nil
  2717. lLeg.Parent = nil
  2718. rLeg.Parent = nil
  2719.  
  2720. weldTo(dTorso, humRootPart)
  2721.  
  2722. for i = 1, 55 do
  2723. corpse.CFrame = corpseCF --*
  2724. --CFrame.Angles(math.rad(-corpse.Orientation.X), 0, math.rad(-corpse.Orientation.Z))
  2725.  
  2726. weldCorpse.C1 = weldCorpse.C1:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, math.rad(90)), 0.075)
  2727. RS:wait()
  2728. end
  2729. for _,p in pairs(corpse:GetChildren()) do
  2730. p:Destroy()
  2731. end
  2732.  
  2733. corpse.Anchored = true
  2734.  
  2735. local smoke = Instance.new("ParticleEmitter", corpse)
  2736. smoke.Size = NumberSequence.new({
  2737. NumberSequenceKeypoint.new(0, 0.6),
  2738. NumberSequenceKeypoint.new(1, 0.6)
  2739. })
  2740. smoke.Texture = "rbxassetid://1494734425"
  2741. smoke.Rate = 100
  2742. smoke.Lifetime = NumberRange.new(0.6, 1.2)
  2743. smoke.Speed = NumberRange.new(2, 5)
  2744. smoke.SpreadAngle = Vector2.new(-30, 30)
  2745.  
  2746. wait(0.07)
  2747.  
  2748. smoke.Enabled = false
  2749.  
  2750. wait(2)
  2751.  
  2752. corpse:Destroy()
  2753. print("You died!")
  2754. end))
  2755. for i,v in pairs(game.Players:GetChildren()) do
  2756. coroutine.resume(coroutine.create(function()
  2757. local sc = Instance.new("ScreenGui",v.PlayerGui)
  2758. sc.Name = "deathmessage"
  2759. local frame = Instance.new("Frame",sc)
  2760. frame.Position = UDim2.new(0,0,0.796,0)
  2761. frame.Size = UDim2.new(0,518,0,112)
  2762. frame.BackgroundTransparency = 1
  2763. local textLabel = Instance.new("TextLabel",frame)
  2764. if diedtofalldamage == false then
  2765. textLabel.Text = player.Name.." died"
  2766. else
  2767. textLabel.Text = player.Name.." fell from a high place"
  2768. end
  2769. textLabel.TextSize = 24
  2770. textLabel.Font = "Arcade"
  2771. textLabel.Size = UDim2.new(1,0,1,0)
  2772. textLabel.Position = UDim2.new(0,1,0,1)
  2773. textLabel.BackgroundTransparency = 0.5
  2774. textLabel.BackgroundColor3 = Color3.new(0, 0, 0)
  2775. textLabel.TextColor3 = Color3.new(255, 255, 255)
  2776. wait(5)
  2777. textLabel.Visible = false
  2778. end))
  2779. end
  2780. print("You died!")
  2781. end
  2782. local CFNew, CFAng, CFEulAng, Rad = CFrame.new, CFrame.Angles, CFrame.fromEulerAnglesXYZ, math.rad
  2783. local neckYRot = Rad(camPart.Orientation.Y - torso.Orientation.Y)
  2784. neck.C1 = CFNew(0, 1.141, 0) * CFEulAng(Rad(sneaking*25), 0, 0)
  2785. neck.C0 = CFNew(0, -0.65, 0)-- * CFAng(-Rad(camPart.Orientation.X - torso.Orientation.X - (sneaking*45)), 0, 0)
  2786. camPart.CFrame = camera.CFrame
  2787. --neck.C0 = neck.C0:lerp(CFrame.new(walkAnim/4 - (walkAnim/8), BobbingY/13, 0), 0.25)
  2788.  
  2789. if getMagnitudeXZ(torso.Velocity) > 1 then
  2790. if walkAnim >= 1 then
  2791. increaseWalkAnim = -1
  2792. elseif walkAnim <= -1 then
  2793. increaseWalkAnim = 1
  2794. end
  2795. walkAnim = walkAnim + (increaseWalkAnim/(10+(sneaking*20))) * ((5 + getMagnitudeXZ(torso.Velocity))/20)
  2796. else
  2797. walkAnim = 0
  2798. end
  2799. --lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*45), 0, 0)
  2800. --rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  2801. lH.C0 = lH.C0:lerp(CFrame.new(0, 0.975, 0) * CFrame.Angles(math.max(math.rad(-60), math.min(math.rad(60), -math.rad(sneaking*25) + math.rad(damageTime*1.5) + math.rad(walkAnim*getMagnitudeXZ(torso.Velocity)*5/(1+sneaking)))), 0, 0), 0.15)
  2802. rH.C0 = rH.C0:lerp(CFrame.new(0, 0.975, 0) * CFrame.Angles(math.max(math.rad(-60), math.min(math.rad(60), math.rad(sneaking*25) + math.rad(damageTime*1.5) + math.rad(walkAnim*getMagnitudeXZ(torso.Velocity)*5/(1+sneaking)))), 0, 0), 0.15)
  2803. --
  2804. --rootJoint.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  2805. --print(math.abs(head.Orientation.Y) - math.abs(humRootPart.Orientation.Y))
  2806. --if (head.Orientation.Y * 2) - (head.Orientation.Y + torso.Orientation.Y) > 45 then
  2807. --humRootPart.CFrame = humRootPart.CFrame * CFrame.Angles(0, math.rad(-45 + head.Orientation.Y), 0)
  2808. --print("-45")
  2809. --end
  2810. --if (head.Orientation.Y * 2) - (head.Orientation.Y + torso.Orientation.Y) < -45 then
  2811. --humRootPart.CFrame = humRootPart.CFrame * CFrame.Angles(0, math.rad(45 + head.Orientation.Y), 0)
  2812. --print("45")
  2813. --end
  2814. dododododo = false
  2815. thingyyyy = true
  2816. coroutine.resume(coroutine.create(function()
  2817. while wait(0.000) do
  2818. if dododododo == true then
  2819. if thingyyyy == true then
  2820. thingyyyy = false
  2821. humanoid.HipHeight = humanoid.HipHeight - 0.001
  2822. wait()
  2823. humanoid.HipHeight = humanoid.HipHeight - 0.001
  2824. wait()
  2825. humanoid.HipHeight = humanoid.HipHeight - 0.005
  2826. wait()
  2827. humanoid.HipHeight = humanoid.HipHeight - 0.050
  2828. wait()
  2829. humanoid.HipHeight = humanoid.HipHeight - 0.050
  2830. wait()
  2831. humanoid.HipHeight = humanoid.HipHeight + 0.050
  2832. wait()
  2833. humanoid.HipHeight = humanoid.HipHeight + 0.050
  2834. wait()
  2835. humanoid.HipHeight = humanoid.HipHeight + 0.005
  2836. wait()
  2837. humanoid.HipHeight = humanoid.HipHeight + 0.001
  2838. wait()
  2839. humanoid.HipHeight = humanoid.HipHeight + 0.001
  2840. wait()
  2841. thingyyyy = true
  2842. end
  2843. end
  2844. end
  2845. end))
  2846. --move these arms
  2847. local BobbingY = walkAnim*2
  2848. if BobbingY >= 1 then BobbingY = 1 BobbingY = -BobbingY end
  2849. humanoid.Running:Connect(function()
  2850. dododododo = true
  2851. end)
  2852. humanoid.PlatformStanding:Connect(function()
  2853. dododododo = false
  2854. end)
  2855.  
  2856. local BobbingX = -0.5 + walkAnim
  2857. --neck.C0 = neck.C0:lerp(CFrame.new(walkAnim/4 - (walkAnim/8), BobbingY/13, 0), 0.25)
  2858. humanoid.CameraOffset = Vector3.new(humOffset.X, humOffset.Y, 0)
  2859.  
  2860. rootJoint.C1 = rootJoint.C1:lerp(CFrame.new(0, 0.325, 0) * CFrame.Angles(math.rad(sneaking*25), math.rad(punchRotY), 0), 0.2)
  2861.  
  2862. rootJoint.C1 = rootJoint.C1:lerp(CFrame.new(0, 0.325, 0) * CFrame.Angles(math.rad(sneaking*25), math.rad(punchRotY), 0), 0.2)
  2863.  
  2864. lS.C0 = lS.C0:lerp(CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(math.max(math.rad(-60), math.min(math.rad(60), idleAnimRotX/20 + math.rad(-hasItemOnHand*10) + math.rad(punchRotX) + math.rad(damageTime*1.5) + math.rad(walkAnim*getMagnitudeXZ(torso.Velocity)*5/(1+sneaking)))), 0, math.rad(punchRotZ) + idleAnimRotZ/20), 0.025+(math.min(1, getMagnitudeXZ(torso.Velocity))/12)*2 + divide(punchSpeed, 6) + hi)
  2865. rS.C0 = rS.C0:lerp(CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(math.max(math.rad(-60), math.min(math.rad(60), idleAnimRotX/20 + math.rad(damageTime*1.5) + math.rad(walkAnim*getMagnitudeXZ(torso.Velocity)*5/(1+sneaking)))), 0, idleAnimRotZ/20), 0.025+(math.min(1, getMagnitudeXZ(torso.Velocity))/12)*2)
  2866.  
  2867. if Mouse.Target and getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  2868. selectBox.Adornee = Mouse.Target
  2869. else
  2870. selectBox.Adornee = nil
  2871. end
  2872.  
  2873. if punching == 1 and punchEnded == 1 then
  2874. punching = 0
  2875. --print("steve uses punch!!")
  2876. local coPunch = coroutine.wrap(function()
  2877. punchEnded = 0
  2878. punchSpeed = 1
  2879. punchRotX = -60
  2880. punchRotY = -8
  2881. punchRotZ = -35
  2882. wait(0.075)
  2883. punchSpeed = 1
  2884. punchRotX = -75
  2885. punchRotY = 8
  2886. punchRotZ = 40
  2887. wait(0.075)
  2888. punchSpeed = 1
  2889. punchRotX = -20
  2890. punchRotZ = 40
  2891. wait(0.075)
  2892. punchSpeed = 3.5
  2893. punchRotX = 0
  2894. punchRotY = 0
  2895. punchRotZ = 0
  2896. punchEnded = 1
  2897. wait(0.06)
  2898. punchSpeed = 0
  2899. end)
  2900. coPunch()
  2901. end
  2902.  
  2903. if ticks > 20 then
  2904. ticks = 0
  2905. if times == 0 then
  2906. times = times + 1
  2907. idleAnimRotX = -1
  2908. idleAnimRotZ = 0
  2909. elseif times == 1 then
  2910. times = times + 1
  2911. idleAnimRotX = -0.75
  2912. idleAnimRotZ = -0.75
  2913. elseif times == 2 then
  2914. times = times + 1
  2915. idleAnimRotX = 0
  2916. idleAnimRotZ = -1
  2917. elseif times == 3 then
  2918. times = times + 1
  2919. idleAnimRotX = 0.75
  2920. idleAnimRotZ = -0.75
  2921. --idleAnimRotX = 0.75
  2922. --idleAnimRotZ = -0
  2923. elseif times == 4 then
  2924. times = times + 1
  2925. idleAnimRotX = 1
  2926. idleAnimRotZ = 0
  2927. --idleAnimRotX = 1
  2928. --idleAnimRotZ = 0
  2929. elseif times == 5 then
  2930. times = times + 1
  2931. idleAnimRotX = 0.75
  2932. idleAnimRotZ = 0.75
  2933. elseif times == 6 then
  2934. times = times + 1
  2935. idleAnimRotX = 0
  2936. idleAnimRotZ = 1
  2937. elseif times == 7 then
  2938. times = 0
  2939. idleAnimRotX = -0.75
  2940. idleAnimRotZ = 0.75
  2941. end
  2942. end
  2943. if hi == 1 then hi = 0 end
  2944. ticks = ticks + 1
  2945. end
  2946.  
  2947. end
  2948.  
  2949. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement