sIendytubble

badboyhalo steve edition (testing)

May 10th, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 158.58 KB | None | 0 0
  1.  
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. local RealPlayer = Player
  4. local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer warn'youngmacka123s minecraft script.'
  5.  
  6. -- ORIGINAL CREATOR: Depr1
  7. --Fixed lags by stommmDev for toasters if the creator wants to shut down this script i will
  8. -- If this script isn't on pastebin or the user who uploaded this isn't called "Delros12"
  9. -- (and yes my pastebin account is Delros12) or the link is not https://pastebin.com/2NNDTLjL
  10. -- then this is not the original link of this script.
  11.  
  12. -- The original link of the script gets edited constantly for updates, if you use the original
  13. -- link you will be able to enjoy the most recent updates of this script without changing to
  14. -- another link which contains updated script.
  15.  
  16. -- Enjoy! :)
  17. -- Controls: Q to sneak, use the keypad numbers 1-9 to change blocks, choose a empty slot i
  18. -- you want to remove a block.
  19. -- if your a noob who wants alex back then republish this pastebin and add "rbxassetid://295150002", in the faces
  20. faces = {"http://www.roblox.com/asset/?id=4823712466"}
  21. local Changelog = [[
  22.  
  23. Hey, thanks for using my Steve script!
  24. (WOOHOO! Void Script Builder Compatible!!)
  25. updateBoard V1.0.2
  26. ChangeLogs:
  27. 4/28/2020:
  28. -remove alex
  29. MEGA UPDATE!!!!!!!!
  30. only TWO thing though but its big
  31. CAMERA FOLLOW!
  32. First Person Hand
  33. also you cant break your neck :3
  34. i have a hope for camera following so just you wait :) i will try to add it
  35. 4/15/2020:
  36. added alex skin back
  37. 4/12/2020:
  38. -added a diamond sword to enable/disable it press F
  39. Notice:
  40. i am starting to remove the lower changelogs so you can click the x on the
  41. changelog gui
  42. removed the thing where it wont let you break your neck since it makes
  43. your character stuck in the same position when you load the script fixed a bug with the head to mouse follow where if you crouch your head
  44. orientation would be on the X part of orientation
  45. HUGE ONE!
  46. Added camera follow(PS IT ISNT LIKE REAL ONE.IT FOLLOWS THE MOUSE since you cant use camera in fe scripts and also
  47. the head can also glitch a bit while turning your head so yeah i
  48. will fix that soon
  49. also also
  50. you cant break your neck with the head follows mouse)
  51. CONTROLS:
  52. press w 2 times for sprint
  53. press b to place a block
  54. press e to change block in the toolbar
  55. click a block in the creative inventory or in the toolbar-
  56. to put a block back or get one out-
  57. -(you dont have to hold it you only have to click twice.one-
  58. to pick second to put)
  59. press p to place a sign(make your your mouse is facing a part)
  60. press q to crouch
  61. Special Note:
  62. im letting people become a beta tester to some of my new features for FREE!
  63. dm on discord at Boeing 767#8836 if you want to test some new features.
  64. Beta Testers:
  65. guest712921
  66. ]]
  67. -- this script will transform you into steve when used
  68. function getSideByLocation(loc)
  69. local side = nil
  70. if loc.X < 0 then side = "Left" end
  71. if loc.X > 0 then side = "Right" end
  72. if loc.Y > 0 then side = "Top" end
  73. if loc.Y < 0 then side = "Bottom" end
  74. if loc.Z < 0 then side = "Front" end
  75. if loc.Z > 0 then side = "Back" end
  76.  
  77. if (math.abs(loc.X) > 0 and math.abs(loc.Y) > 0) or
  78. (math.abs(loc.X) > 0 and math.abs(loc.Z) > 0) or
  79. (math.abs(loc.Y) > 0 and math.abs(loc.Z) > 0)
  80. then
  81. return nil
  82. end
  83. return side
  84. end
  85. workspace:WaitForChild("Camera"):ClearAllChildren()
  86. local RS = game:GetService("RunService").RenderStepped
  87. local targetName = owner.Name
  88. local player = owner
  89. function putTexture(part, frontF, backF, topF, bottomF, leftF, rightF, className)
  90. local faces = {"Front", "Back", "Top", "Bottom", "Left", "Right"}
  91. for i,f in pairs(faces) do
  92. local decal = Instance.new(className, part)
  93. if i == 1 then decal.Texture = frontF decal.Name = f end
  94. if i == 2 then decal.Texture = backF or frontF decal.Name = f end
  95. if i == 3 then decal.Texture = topF or frontF decal.Name = f end
  96. if i == 4 then decal.Texture = bottomF or frontF decal.Name = f end
  97. if i == 5 then decal.Texture = leftF or frontF decal.Name = f end
  98. if i == 6 then decal.Texture = rightF or frontF decal.Name = f end
  99. decal.Face = f
  100. end
  101. return part
  102. end
  103. function makeSquare(position, size, color, transparency, parent, zindex)
  104. local label = Instance.new("TextLabel", parent)
  105. label.Text = ""
  106. label.BorderSizePixel = 0
  107. label.BackgroundTransparency = transparency
  108. label.Position = position
  109. label.Size = size
  110. label.BackgroundColor3 = color
  111. if zindex == nil then label.ZIndex = 1 else label.ZIndex = zindex end
  112. return label
  113. end
  114. function AngleDifference(Angle1, Angle2)
  115. local Difference = {X = 0, Y = 0, Z = 0}
  116. Difference.X = Angle2.X - Angle1.X
  117.  
  118. if (Difference.X > 180) then
  119. Difference.X = Difference.X - 360
  120. elseif (Difference.X < -180) then
  121. Difference.X = Difference.X + 360
  122. end
  123.  
  124. Difference.Y = Angle2.Y - Angle1.Y
  125.  
  126. if (Difference.Y > 180) then
  127. Difference.Y = Difference.Y - 360
  128. elseif (Difference.Y < -180) then
  129. Difference.Y = Difference.Y + 360
  130. end
  131.  
  132. Difference.Z = Angle2.Z - Angle1.Z
  133.  
  134. if (Difference.Z > 180) then
  135. Difference.Z = Difference.Z - 360
  136. elseif (Difference.Z < -180) then
  137. Difference.Z = Difference.Z + 360
  138. end
  139.  
  140. return Vector3.new(Difference.X, Difference.Y, Difference.Z)
  141. end
  142. function makeImage(position, size, image, parent, zindex)
  143. local imglabel = Instance.new("ImageLabel", parent)
  144. imglabel.BorderSizePixel = 0
  145. imglabel.BackgroundTransparency = 1
  146. imglabel.Position = position
  147. imglabel.Size = size
  148. imglabel.Image = image
  149. if zindex == nil then imglabel.ZIndex = 1 else imglabel.ZIndex = zindex end
  150. return imglabel
  151. end
  152. function putToolBarSlot(position, image, zindex)
  153. local playerGui = player:FindFirstChild("PlayerGui")
  154. if playerGui then
  155. local gui = playerGui:FindFirstChild("ToolBar") or Instance.new("ScreenGui", playerGui)
  156. gui.Name = "ToolBar"
  157. local slot = Instance.new("ImageLabel", gui)
  158. slot.Position = position
  159. slot.Size = UDim2.new(0, 32, 0, 32)
  160. slot.BackgroundTransparency = 1
  161. slot.ImageTransparency = 0
  162. slot.Image = image
  163. slot.ZIndex = 2
  164.  
  165. local imgSlot = makeImage(UDim2.new(0, 0, 0, 0), UDim2.new(0, 32, 0, 32),
  166. "rbxassetid://347007448", slot)
  167.  
  168. imgSlot.ImageTransparency = 0.25
  169. imgSlot.BackgroundTransparency = 1
  170. imgSlot.ImageColor3 = Color3.new(0.225, 0.225, 0.225)
  171.  
  172. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 2, 0, 32),
  173. Color3.new(0/255, 0/255, 0/255), 0.7, slot)
  174. makeSquare(UDim2.new(0, 2, 0, 0), UDim2.new(0, 30, 0, 2),
  175. Color3.new(0/255, 0/255, 0/255), 0.7, slot)
  176. makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 36, 0, 2),
  177. Color3.new(106/255, 106/255, 106/255), 0, slot)
  178. makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 2, 0, 36),
  179. Color3.new(106/255, 106/255, 106/255), 0, slot)
  180. makeSquare(UDim2.new(0, 0, 0, 32), UDim2.new(0, 34, 0, 2),
  181. Color3.new(130/255, 130/255, 130/255), 0, slot)
  182. makeSquare(UDim2.new(0, 32, 0, 0), UDim2.new(0, 2, 0, 34),
  183. Color3.new(130/255, 130/255, 130/255), 0, slot)
  184. makeSquare(UDim2.new(0, -4, 0, -2), UDim2.new(0, 2, 0, 38),
  185. Color3.new(130/255, 130/255, 130/255), 0, slot)
  186. makeSquare(UDim2.new(0, 34, 0, -2), UDim2.new(0, 2, 0, 36),
  187. Color3.new(106/255, 106/255, 106/255), 0, slot)
  188. makeSquare(UDim2.new(0, -2, 0, 34), UDim2.new(0, 38, 0, 2),
  189. Color3.new(106/255, 106/255, 106/255), 0, slot)
  190. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 40, 0, 2),
  191. Color3.new(156/255, 156/255, 156/255), 0, slot)
  192. return slot
  193. end
  194. end
  195. function divide(x, d)
  196. if x ~= 0 and d ~= 0 then
  197. return x/d
  198. else
  199. return x
  200. end
  201. end -- so it doesn't divide by zero
  202. function getDistance(v1, v2)
  203. return math.abs((Vector3.new(math.abs(v2.X - v1.X), math.abs(v2.Y - v1.Y), math.abs(v2.Z - v1.Z))).Magnitude)
  204. end
  205. function SnapToGrid(x, gridX)
  206. local x = math.floor((x / gridX) + 0.5) * gridX
  207. return x
  208. end
  209.  
  210. function round(x)
  211. if x%2 ~= 0.5 then
  212. return math.floor(x+0.5)
  213. end
  214. return x-0.5
  215. end
  216. function weldTo(part1, part2)
  217. local weld = Instance.new("Weld", part1)
  218. weld.Part0 = part1
  219. weld.Part1 = part2
  220. end
  221. function getMagnitudeXZ(velocity)
  222. return math.abs(velocity.X) + math.abs(velocity.Z)
  223. end
  224. function getBlockAtRegion(region)
  225. local blockFound = nil
  226. for _,part in pairs(game.Workspace:FindPartsInRegion3(region, nil, math.huge)) do
  227. local usePart = true
  228. if part.Name == "Debris" then usePart = false end
  229. if usePart == true then
  230. blockFound = part
  231. break
  232. end
  233. end
  234. return blockFound
  235. end
  236. local RS = game:GetService("RunService").RenderStepped
  237. local creativeInventory = {
  238. {
  239. name = "Dirt",
  240. size = Vector3.new(2.6, 2.6, 2.6),
  241. transparency = 0;
  242. frontTex = "rbxassetid://152569532",
  243. backTex = "rbxassetid://152569532",
  244. topTex = "rbxassetid://152569532",
  245. bottomTex = "rbxassetid://152569532",
  246. leftTex = "rbxassetid://152569532",
  247. rightTex = "rbxassetid://152569532",
  248. displayTex = "",
  249. sound = "rbxassetid://1102186681",
  250. soundVol = 1.25,
  251. hasGravity = false,
  252. objectType = "Block"
  253. },
  254. {
  255. name = "Grass",
  256. size = Vector3.new(2.6, 2.6, 2.6),
  257. transparency = 0;
  258. frontTex = "rbxassetid://96430337",
  259. backTex = "rbxassetid://96430337",
  260. topTex = "rbxassetid://96430265",
  261. bottomTex = "rbxassetid://179655033",
  262. leftTex = "rbxassetid://96430337",
  263. rightTex = "rbxassetid://96430337",
  264. displayTex = "",
  265. sound = "rbxassetid://1102186681",
  266. soundVol = 1.25,
  267. hasGravity = false,
  268. objectType = "Block"
  269. },
  270. {
  271. name = "Sand",
  272. size = Vector3.new(2.6, 2.6, 2.6),
  273. transparency = 0;
  274. frontTex = "rbxassetid://347007448",
  275. backTex = "rbxassetid://347007448",
  276. topTex = "rbxassetid://347007448",
  277. bottomTex = "rbxassetid://347007448",
  278. leftTex = "rbxassetid://347007448",
  279. rightTex = "rbxassetid://347007448",
  280. displayTex = "",
  281. sound = "rbxassetid://1102186681",
  282. soundVol = 1.25,
  283. hasGravity = true,
  284. objectType = "Block"
  285. },
  286. {
  287. name = "Gravel",
  288. size = Vector3.new(2.6, 2.6, 2.6),
  289. transparency = 0;
  290. frontTex = "rbxassetid://151701568",
  291. backTex = "rbxassetid://151701568",
  292. topTex = "rbxassetid://151701568",
  293. bottomTex = "rbxassetid://151701568",
  294. leftTex = "rbxassetid://151701568",
  295. rightTex = "rbxassetid://151701568",
  296. displayTex = "",
  297. sound = "rbxassetid://1102186681",
  298. soundVol = 1.25,
  299. hasGravity = true,
  300. objectType = "Block"
  301. },
  302. {
  303. name = "Stone",
  304. size = Vector3.new(2.6, 2.6, 2.6),
  305. transparency = 0;
  306. frontTex = "rbxassetid://75880927",
  307. backTex = "rbxassetid://75880927",
  308. topTex = "rbxassetid://75880927",
  309. bottomTex = "rbxassetid://75880927",
  310. leftTex = "rbxassetid://75880927",
  311. rightTex = "rbxassetid://75880927",
  312. displayTex = "",
  313. sound = "rbxassetid://1016978163",
  314. soundVol = 2,
  315. hasGravity = false,
  316. objectType = "Block"
  317. },
  318. {
  319. name = "Diamond Ore",
  320. size = Vector3.new(2.6, 2.6, 2.6),
  321. transparency = 0;
  322. frontTex = "rbxassetid://57928490",
  323. backTex = "rbxassetid://57928490",
  324. topTex = "rbxassetid://57928490",
  325. bottomTex = "rbxassetid://57928490",
  326. leftTex = "rbxassetid://57928490",
  327. rightTex = "rbxassetid://57928490",
  328. displayTex = "",
  329. sound = "rbxassetid://1016978163",
  330. soundVol = 2,
  331. hasGravity = false,
  332. objectType = "Block"
  333. },
  334. {
  335. name = "Diamond Block",
  336. size = Vector3.new(2.6, 2.6, 2.6),
  337. transparency = 0;
  338. frontTex = "rbxassetid://56749955",
  339. backTex = "rbxassetid://56749955",
  340. topTex = "rbxassetid://56749955",
  341. bottomTex = "rbxassetid://56749955",
  342. leftTex = "rbxassetid://56749955",
  343. rightTex = "rbxassetid://56749955",
  344. displayTex = "",
  345. sound = "rbxassetid://1016978163",
  346. soundVol = 2,
  347. hasGravity = false,
  348. objectType = "Block"
  349. },
  350. {
  351. name = "Emerald Block",
  352. size = Vector3.new(2.6, 2.6, 2.6),
  353. transparency = 0;
  354. frontTex = "rbxassetid://152410853",
  355. backTex = "rbxassetid://152410853",
  356. topTex = "rbxassetid://152410853",
  357. bottomTex = "rbxassetid://152410853",
  358. leftTex = "rbxassetid://152410853",
  359. rightTex = "rbxassetid://152410853",
  360. displayTex = "",
  361. sound = "rbxassetid://1016978163",
  362. soundVol = 2,
  363. hasGravity = false,
  364. objectType = "Block"
  365. },
  366. {
  367. name = "Emerald Ore",
  368. size = Vector3.new(2.6, 2.6, 2.6),
  369. transparency = 0;
  370. frontTex = "rbxassetid://152410868",
  371. backTex = "rbxassetid://152410868",
  372. topTex = "rbxassetid://152410868",
  373. bottomTex = "rbxassetid://152410868",
  374. leftTex = "rbxassetid://152410868",
  375. rightTex = "rbxassetid://152410868",
  376. displayTex = "",
  377. sound = "rbxassetid://1016978163",
  378. soundVol = 2,
  379. hasGravity = false,
  380. objectType = "Block"
  381. },
  382. {
  383. name = "Obsidian",
  384. size = Vector3.new(2.6, 2.6, 2.6),
  385. transparency = 0;
  386. frontTex = "rbxassetid://112560322",
  387. backTex = "rbxassetid://112560322",
  388. topTex = "rbxassetid://112560322",
  389. bottomTex = "rbxassetid://112560322",
  390. leftTex = "rbxassetid://112560322",
  391. rightTex = "rbxassetid://112560322",
  392. displayTex = "",
  393. sound = "rbxassetid://1016978163",
  394. soundVol = 2,
  395. hasGravity = false,
  396. objectType = "Block"
  397. },
  398. {
  399. name = "Gold Block",
  400. size = Vector3.new(2.6, 2.6, 2.6),
  401. transparency = 0;
  402. frontTex = "rbxassetid://152572128",
  403. backTex = "rbxassetid://152572128",
  404. topTex = "rbxassetid://152572128",
  405. bottomTex = "rbxassetid://152572128",
  406. leftTex = "rbxassetid://152572128",
  407. rightTex = "rbxassetid://152572128",
  408. displayTex = "",
  409. sound = "rbxassetid://1016978163",
  410. soundVol = 2,
  411. hasGravity = false,
  412. objectType = "Block"
  413. },
  414. {
  415. name = "Gold Ore",
  416. size = Vector3.new(2.6, 2.6, 2.6),
  417. transparency = 0;
  418. frontTex = "rbxassetid://152572121",
  419. backTex = "rbxassetid://152572121",
  420. topTex = "rbxassetid://152572121",
  421. bottomTex = "rbxassetid://152572121",
  422. leftTex = "rbxassetid://152572121",
  423. rightTex = "rbxassetid://152572121",
  424. displayTex = "",
  425. sound = "rbxassetid://1016978163",
  426. soundVol = 2,
  427. hasGravity = false,
  428. objectType = "Block"
  429. },
  430. {
  431. name = "Iron Block",
  432. size = Vector3.new(2.6, 2.6, 2.6),
  433. transparency = 0;
  434. frontTex = "rbxassetid://152572134",
  435. backTex = "rbxassetid://152572134",
  436. topTex = "rbxassetid://152572134",
  437. bottomTex = "rbxassetid://152572134",
  438. leftTex = "rbxassetid://152572134",
  439. rightTex = "rbxassetid://152572134",
  440. displayTex = "",
  441. sound = "rbxassetid://1016978163",
  442. soundVol = 2,
  443. hasGravity = false,
  444. objectType = "Block"
  445. },
  446. {
  447. name = "Iron Ore",
  448. size = Vector3.new(2.6, 2.6, 2.6),
  449. transparency = 0;
  450. frontTex = "rbxassetid://132879562",
  451. backTex = "rbxassetid://132879562",
  452. topTex = "rbxassetid://132879562",
  453. bottomTex = "rbxassetid://132879562",
  454. leftTex = "rbxassetid://132879562",
  455. rightTex = "rbxassetid://132879562",
  456. displayTex = "",
  457. sound = "rbxassetid://1016978163",
  458. soundVol = 2,
  459. hasGravity = false,
  460. objectType = "Block"
  461. },
  462. {
  463. name = "Redstone Block",
  464. size = Vector3.new(2.6, 2.6, 2.6),
  465. transparency = 0;
  466. frontTex = "rbxassetid://136260219",
  467. backTex = "rbxassetid://136260219",
  468. topTex = "rbxassetid://136260219",
  469. bottomTex = "rbxassetid://136260219",
  470. leftTex = "rbxassetid://136260219",
  471. rightTex = "rbxassetid://136260219",
  472. sound = "rbxassetid://1016978163",
  473. soundVol = 2,
  474. hasGravity = false,
  475. objectType = "Block"
  476. },
  477. {
  478. name = "TNT",
  479. size = Vector3.new(2.6, 2.6, 2.6),
  480. transparency = 0;
  481. frontTex = "rbxassetid://48005067",
  482. backTex = "rbxassetid://48005067",
  483. topTex = "rbxassetid://48005073",
  484. bottomTex = "rbxassetid://48005064",
  485. leftTex = "rbxassetid://48005067",
  486. rightTex = "rbxassetid://48005067",
  487. displayTex = "",
  488. sound = "rbxassetid://1102186681",
  489. soundVol = 2,
  490. hasGravity = false,
  491. isExplosive = true,
  492. objectType = "Block"
  493. },
  494. {
  495. name = "Coal Block",
  496. size = Vector3.new(2.6, 2.6, 2.6),
  497. transparency = 0;
  498. frontTex = "rbxassetid://152527418",
  499. backTex = "rbxassetid://152527418",
  500. topTex = "rbxassetid://152527418",
  501. bottomTex = "rbxassetid://152527418",
  502. leftTex = "rbxassetid://152527418",
  503. rightTex = "rbxassetid://152527418",
  504. displayTex = "",
  505. sound = "rbxassetid://1016978163",
  506. soundVol = 2,
  507. hasGravity = false,
  508. objectType = "Block"
  509. },
  510. {
  511. name = "Coal Ore",
  512. size = Vector3.new(2.6, 2.6, 2.6),
  513. transparency = 0;
  514. frontTex = "rbxassetid://152572101",
  515. backTex = "rbxassetid://152572101",
  516. topTex = "rbxassetid://152572101",
  517. bottomTex = "rbxassetid://152572101",
  518. leftTex = "rbxassetid://152572101",
  519. rightTex = "rbxassetid://152572101",
  520. displayTex = "",
  521. sound = "rbxassetid://1016978163",
  522. soundVol = 2,
  523. hasGravity = false,
  524. objectType = "Block"
  525. },
  526. {
  527. name = "Bedrock",
  528. size = Vector3.new(2.6, 2.6, 2.6),
  529. transparency = 0;
  530. frontTex = "rbxassetid://75881126",
  531. backTex = "rbxassetid://75881126",
  532. topTex = "rbxassetid://75881126",
  533. bottomTex = "rbxassetid://75881126",
  534. leftTex = "rbxassetid://75881126",
  535. rightTex = "rbxassetid://75881126",
  536. displayTex = "",
  537. sound = "rbxassetid://1016978163",
  538. soundVol = 2,
  539. hasGravity = false,
  540. objectType = "Block"
  541. },
  542. {
  543. name = "Cobblestone",
  544. size = Vector3.new(2.6, 2.6, 2.6),
  545. transparency = 0;
  546. frontTex = "rbxassetid://152572105",
  547. backTex = "rbxassetid://152572105",
  548. topTex = "rbxassetid://152572105",
  549. bottomTex = "rbxassetid://152572105",
  550. leftTex = "rbxassetid://152572105",
  551. rightTex = "rbxassetid://152572105",
  552. displayTex = "",
  553. sound = "rbxassetid://1016978163",
  554. soundVol = 2,
  555. hasGravity = false,
  556. objectType = "Block"
  557. },
  558. {
  559. name = "Mossy Stone Brick",
  560. size = Vector3.new(2.6, 2.6, 2.6),
  561. transparency = 0;
  562. frontTex = "rbxassetid://61826751",
  563. backTex = "rbxassetid://61826751",
  564. topTex = "rbxassetid://61826751",
  565. bottomTex = "rbxassetid://61826751",
  566. leftTex = "rbxassetid://61826751",
  567. rightTex = "rbxassetid://61826751",
  568. displayTex = "",
  569. sound = "rbxassetid://1016978163",
  570. soundVol = 2,
  571. hasGravity = false,
  572. objectType = "Block"
  573. },
  574. {
  575. name = "Cracked Stone Brick",
  576. size = Vector3.new(2.6, 2.6, 2.6),
  577. transparency = 0;
  578. frontTex = "rbxassetid://151802087",
  579. backTex = "rbxassetid://151802087",
  580. topTex = "rbxassetid://151802087",
  581. bottomTex = "rbxassetid://151802087",
  582. leftTex = "rbxassetid://151802087",
  583. rightTex = "rbxassetid://151802087",
  584. displayTex = "",
  585. sound = "rbxassetid://1016978163",
  586. soundVol = 2,
  587. hasGravity = false,
  588. objectType = "Block"
  589. },
  590. {
  591. name = "Chiseled Stone Brick",
  592. size = Vector3.new(2.6, 2.6, 2.6),
  593. transparency = 0;
  594. frontTex = "rbxassetid://151802074",
  595. backTex = "rbxassetid://151802074",
  596. topTex = "rbxassetid://151802074",
  597. bottomTex = "rbxassetid://151802074",
  598. leftTex = "rbxassetid://151802074",
  599. rightTex = "rbxassetid://151802074",
  600. displayTex = "",
  601. sound = "rbxassetid://1016978163",
  602. soundVol = 2,
  603. hasGravity = false,
  604. objectType = "Block"
  605. },
  606. {
  607. name = "Stone Brick",
  608. size = Vector3.new(2.6, 2.6, 2.6),
  609. transparency = 0;
  610. frontTex = "rbxassetid://61826773",
  611. backTex = "rbxassetid://61826773",
  612. topTex = "rbxassetid://61826773",
  613. bottomTex = "rbxassetid://61826773",
  614. leftTex = "rbxassetid://61826773",
  615. rightTex = "rbxassetid://61826773",
  616. displayTex = "",
  617. sound = "rbxassetid://1016978163",
  618. soundVol = 2,
  619. hasGravity = false,
  620. objectType = "Block"
  621. },
  622. {
  623. name = "Nether Brick",
  624. size = Vector3.new(2.6, 2.6, 2.6),
  625. transparency = 0;
  626. frontTex = "rbxassetid://151802104",
  627. backTex = "rbxassetid://151802104",
  628. topTex = "rbxassetid://151802104",
  629. bottomTex = "rbxassetid://151802104",
  630. leftTex = "rbxassetid://151802104",
  631. rightTex = "rbxassetid://151802104",
  632. displayTex = "",
  633. sound = "rbxassetid://1016978163",
  634. soundVol = 2,
  635. hasGravity = false,
  636. objectType = "Block"
  637. },
  638. {
  639. name = "Granite",
  640. size = Vector3.new(2.6, 2.6, 2.6),
  641. transparency = 0;
  642. frontTex = "rbxassetid://151776467",
  643. backTex = "rbxassetid://151776467",
  644. topTex = "rbxassetid://151776467",
  645. bottomTex = "rbxassetid://151776467",
  646. leftTex = "rbxassetid://151776467",
  647. rightTex = "rbxassetid://151776467",
  648. displayTex = "",
  649. sound = "rbxassetid://1016978163",
  650. soundVol = 2,
  651. hasGravity = false,
  652. objectType = "Block"
  653. },
  654. {
  655. name = "Diorite",
  656. size = Vector3.new(2.6, 2.6, 2.6),
  657. transparency = 0;
  658. frontTex = "rbxassetid://151776452",
  659. backTex = "rbxassetid://151776452",
  660. topTex = "rbxassetid://151776452",
  661. bottomTex = "rbxassetid://151776452",
  662. leftTex = "rbxassetid://151776452",
  663. rightTex = "rbxassetid://151776452",
  664. sound = "rbxassetid://1016978163",
  665. soundVol = 2,
  666. hasGravity = false,
  667. objectType = "Block"
  668. },
  669. {
  670. name = "Andesite",
  671. size = Vector3.new(2.6, 2.6, 2.6),
  672. transparency = 0;
  673. frontTex = "rbxassetid://151776422",
  674. backTex = "rbxassetid://151776422",
  675. topTex = "rbxassetid://151776422",
  676. bottomTex = "rbxassetid://151776422",
  677. leftTex = "rbxassetid://151776422",
  678. rightTex = "rbxassetid://151776422",
  679. displayTex = "",
  680. sound = "rbxassetid://1016978163",
  681. soundVol = 2,
  682. hasGravity = false,
  683. objectType = "Block"
  684. },
  685. {
  686. name = "Polished Granite",
  687. size = Vector3.new(2.6, 2.6, 2.6),
  688. transparency = 0;
  689. frontTex = "rbxassetid://151776506",
  690. backTex = "rbxassetid://151776506",
  691. topTex = "rbxassetid://151776506",
  692. bottomTex = "rbxassetid://151776506",
  693. leftTex = "rbxassetid://151776506",
  694. rightTex = "rbxassetid://151776506",
  695. displayTex = "",
  696. sound = "rbxassetid://1016978163",
  697. soundVol = 2,
  698. hasGravity = false,
  699. objectType = "Block"
  700. },
  701. {
  702. name = "Polished Diorite",
  703. size = Vector3.new(2.6, 2.6, 2.6),
  704. transparency = 0;
  705. frontTex = "rbxassetid://151776533",
  706. backTex = "rbxassetid://151776533",
  707. topTex = "rbxassetid://151776533",
  708. bottomTex = "rbxassetid://151776533",
  709. leftTex = "rbxassetid://151776533",
  710. rightTex = "rbxassetid://151776533",
  711. displayTex = "",
  712. sound = "rbxassetid://1016978163",
  713. soundVol = 2,
  714. hasGravity = false,
  715. objectType = "Block"
  716. },
  717. {
  718. name = "Polished Andesite",
  719. size = Vector3.new(2.6, 2.6, 2.6),
  720. transparency = 0;
  721. frontTex = "rbxassetid://151776506",
  722. backTex = "rbxassetid://151776506",
  723. topTex = "rbxassetid://151776506",
  724. bottomTex = "rbxassetid://151776506",
  725. leftTex = "rbxassetid://151776506",
  726. rightTex = "rbxassetid://151776506",
  727. displayTex = "",
  728. sound = "rbxassetid://1016978163",
  729. soundVol = 2,
  730. hasGravity = false,
  731. objectType = "Block"
  732. },
  733. {
  734. name = "Brick Block",
  735. size = Vector3.new(2.6, 2.6, 2.6),
  736. transparency = 0;
  737. frontTex = "rbxassetid://59389191",
  738. backTex = "rbxassetid://59389191",
  739. topTex = "rbxassetid://59389191",
  740. bottomTex = "rbxassetid://59389191",
  741. leftTex = "rbxassetid://59389191",
  742. rightTex = "rbxassetid://59389191",
  743. displayTex = "",
  744. sound = "rbxassetid://1016978163",
  745. soundVol = 2,
  746. hasGravity = false,
  747. objectType = "Block"
  748. },
  749. {
  750. name = "Packed Ice",
  751. size = Vector3.new(2.6, 2.6, 2.6),
  752. transparency = 0;
  753. frontTex = "rbxassetid://152528023",
  754. backTex = "rbxassetid://152528023",
  755. topTex = "rbxassetid://152528023",
  756. bottomTex = "rbxassetid://152528023",
  757. leftTex = "rbxassetid://152528023",
  758. rightTex = "rbxassetid://152528023",
  759. displayTex = "",
  760. sound = "rbxassetid://1016978163",
  761. soundVol = 2,
  762. hasGravity = false,
  763. objectType = "Block"
  764. },
  765. {
  766. name = "Ice Block",
  767. size = Vector3.new(2.6, 2.6, 2.6),
  768. transparency = 1;
  769. frontTex = "rbxassetid://118555586",
  770. backTex = "rbxassetid://118555586",
  771. topTex = "rbxassetid://118555586",
  772. bottomTex = "rbxassetid://118555586",
  773. leftTex = "rbxassetid://118555586",
  774. rightTex = "rbxassetid://118555586",
  775. displayTex = "",
  776. sound = "rbxassetid://1016978163",
  777. soundVol = 2,
  778. hasGravity = false,
  779. objectType = "Block"
  780. },
  781. {
  782. name = "Netherrack",
  783. size = Vector3.new(2.6, 2.6, 2.6),
  784. transparency = 0;
  785. frontTex = "rbxassetid://151802119",
  786. backTex = "rbxassetid://151802119",
  787. topTex = "rbxassetid://151802119",
  788. bottomTex = "rbxassetid://151802119",
  789. leftTex = "rbxassetid://151802119",
  790. rightTex = "rbxassetid://151802119",
  791. displayTex = "",
  792. sound = "rbxassetid://1016978163",
  793. soundVol = 2,
  794. hasGravity = false,
  795. objectType = "Block"
  796. },
  797. {
  798. name = "End Stone",
  799. size = Vector3.new(2.6, 2.6, 2.6),
  800. transparency = 0;
  801. frontTex = "rbxassetid://151802091",
  802. backTex = "rbxassetid://151802091",
  803. topTex = "rbxassetid://151802091",
  804. bottomTex = "rbxassetid://151802091",
  805. leftTex = "rbxassetid://151802091",
  806. rightTex = "rbxassetid://151802091",
  807. displayTex = "",
  808. sound = "rbxassetid://1016978163",
  809. soundVol = 2,
  810. hasGravity = false,
  811. objectType = "Block"
  812. },
  813. {
  814. name = "Glass Block",
  815. size = Vector3.new(2.6, 2.6, 2.6),
  816. transparency = 1;
  817. frontTex = "rbxassetid://152239003",
  818. backTex = "rbxassetid://152239003",
  819. topTex = "rbxassetid://152239003",
  820. bottomTex = "rbxassetid://152239003",
  821. leftTex = "rbxassetid://152239003",
  822. rightTex = "rbxassetid://152239003",
  823. displayTex = "",
  824. sound = "rbxassetid://1016978163",
  825. soundVol = 2,
  826. hasGravity = false,
  827. objectType = "Block"
  828. },
  829. {
  830. name = "Glowstone",
  831. size = Vector3.new(2.6, 2.6, 2.6),
  832. transparency = 0;
  833. frontTex = "rbxassetid://54790811",
  834. backTex = "rbxassetid://54790811",
  835. topTex = "rbxassetid://54790811",
  836. bottomTex = "rbxassetid://54790811",
  837. leftTex = "rbxassetid://54790811",
  838. rightTex = "rbxassetid://54790811",
  839. displayTex = "",
  840. sound = "rbxassetid://1016978163",
  841. soundVol = 2,
  842. hasGravity = false,
  843. objectType = "Block"
  844. },
  845. {
  846. name = "Bookshelf",
  847. size = Vector3.new(2.6, 2.6, 2.6),
  848. transparency = 0;
  849. frontTex = "rbxassetid://118554092",
  850. backTex = "rbxassetid://118554092",
  851. topTex = "rbxassetid://346201871",
  852. bottomTex = "rbxassetid://346201871",
  853. leftTex = "rbxassetid://118554092",
  854. rightTex = "rbxassetid://118554092",
  855. displayTex = "",
  856. sound = "rbxassetid://507863457",
  857. soundVol = 2,
  858. hasGravity = false,
  859. objectType = "Block"
  860. },
  861. {
  862. name = "Oak Wood Planks",
  863. size = Vector3.new(2.6, 2.6, 2.6),
  864. transparency = 0;
  865. frontTex = "rbxassetid://346201871",
  866. backTex = "rbxassetid://346201871",
  867. topTex = "rbxassetid://346201871",
  868. bottomTex = "rbxassetid://346201871",
  869. leftTex = "rbxassetid://346201871",
  870. rightTex = "rbxassetid://346201871",
  871. displayTex = "",
  872. sound = "rbxassetid://507863457",
  873. soundVol = 2,
  874. hasGravity = false,
  875. objectType = "Block"
  876. },
  877. {
  878. name = "Oak Log",
  879. size = Vector3.new(2.6, 2.6, 2.6),
  880. transparency = 0;
  881. frontTex = "rbxassetid://71445924",
  882. backTex = "rbxassetid://71445924",
  883. topTex = "rbxassetid://152538557",
  884. bottomTex = "rbxassetid://152538557",
  885. leftTex = "rbxassetid://71445924",
  886. rightTex = "rbxassetid://71445924",
  887. displayTex = "",
  888. sound = "rbxassetid://507863457",
  889. soundVol = 2,
  890. hasGravity = false,
  891. objectType = "Block"
  892. },
  893. {
  894. name = "Oak Leaves",
  895. size = Vector3.new(2.6, 2.6, 2.6),
  896. transparency = 1;
  897. frontTex = "rbxassetid://151708391",
  898. backTex = "rbxassetid://151708391",
  899. topTex = "rbxassetid://151708391",
  900. bottomTex = "rbxassetid://151708391",
  901. leftTex = "rbxassetid://151708391",
  902. rightTex = "rbxassetid://151708391",
  903. displayTex = "",
  904. sound = "rbxassetid://507863457",
  905. -- couldn't find a leaves sound for this one, sorry lol
  906. soundVol = 2,
  907. hasGravity = false,
  908. objectType = "Block"
  909. }
  910. }
  911. local toolBar = {
  912. {
  913. name = "Dirt Block",
  914. size = Vector3.new(2.6, 2.6, 2.6),
  915. transparency = 0;
  916. frontTex = "rbxassetid://152569532",
  917. backTex = "rbxassetid://152569532",
  918. topTex = "rbxassetid://152569532",
  919. bottomTex = "rbxassetid://152569532",
  920. leftTex = "rbxassetid://152569532",
  921. rightTex = "rbxassetid://152569532",
  922. displayTex = "",
  923. sound = "rbxassetid://1102186681",
  924. soundVol = 1.25,
  925. hasGravity = false,
  926. objectType = "Block"
  927. },
  928. {
  929. name = "Grass Block",
  930. size = Vector3.new(2.6, 2.6, 2.6),
  931. transparency = 0;
  932. frontTex = "rbxassetid://96430337",
  933. backTex = "rbxassetid://96430337",
  934. topTex = "rbxassetid://96430265",
  935. bottomTex = "rbxassetid://179655033",
  936. leftTex = "rbxassetid://96430337",
  937. rightTex = "rbxassetid://96430337",
  938. displayTex = "",
  939. sound = "rbxassetid://1102186681",
  940. soundVol = 1.25,
  941. hasGravity = false,
  942. objectType = "Block"
  943. },
  944. {
  945. name = "Stone",
  946. size = Vector3.new(2.6, 2.6, 2.6),
  947. transparency = 0;
  948. frontTex = "rbxassetid://75880927",
  949. backTex = "rbxassetid://75880927",
  950. topTex = "rbxassetid://75880927",
  951. bottomTex = "rbxassetid://75880927",
  952. leftTex = "rbxassetid://75880927",
  953. rightTex = "rbxassetid://75880927",
  954. displayTex = "",
  955. sound = "rbxassetid://1016978163",
  956. soundVol = 2,
  957. hasGravity = false,
  958. objectType = "Block"
  959. },
  960. {
  961. name = "Diamond Ore",
  962. size = Vector3.new(2.6, 2.6, 2.6),
  963. transparency = 0;
  964. frontTex = "rbxassetid://152572119",
  965. backTex = "rbxassetid://152572119",
  966. topTex = "rbxassetid://152572119",
  967. bottomTex = "rbxassetid://152572119",
  968. leftTex = "rbxassetid://152572119",
  969. rightTex = "rbxassetid://152572119",
  970. displayTex = "",
  971. sound = "rbxassetid://1016978163",
  972. soundVol = 2,
  973. hasGravity = false,
  974. objectType = "Block"
  975. },
  976. {
  977. name = "Diamond Block",
  978. size = Vector3.new(2.6, 2.6, 2.6),
  979. transparency = 0;
  980. frontTex = "rbxassetid://56749955",
  981. backTex = "rbxassetid://56749955",
  982. topTex = "rbxassetid://56749955",
  983. bottomTex = "rbxassetid://56749955",
  984. leftTex = "rbxassetid://56749955",
  985. rightTex = "rbxassetid://56749955",
  986. displayTex = "",
  987. sound = "rbxassetid://1016978163",
  988. soundVol = 2,
  989. hasGravity = false,
  990. objectType = "Block"
  991. },
  992. {
  993. name = "Oak Wood Planks",
  994. size = Vector3.new(2.6, 2.6, 2.6),
  995. transparency = 0;
  996. frontTex = "rbxassetid://346201871",
  997. backTex = "rbxassetid://346201871",
  998. topTex = "rbxassetid://346201871",
  999. bottomTex = "rbxassetid://346201871",
  1000. leftTex = "rbxassetid://346201871",
  1001. rightTex = "rbxassetid://346201871",
  1002. displayTex = "",
  1003. sound = "rbxassetid://507863457",
  1004. soundVol = 2,
  1005. hasGravity = false,
  1006. objectType = "Block"
  1007. },
  1008. {
  1009. name = "Oak Log",
  1010. size = Vector3.new(2.6, 2.6, 2.6),
  1011. transparency = 0;
  1012. frontTex = "rbxassetid://71445924",
  1013. backTex = "rbxassetid://71445924",
  1014. topTex = "rbxassetid://152538557",
  1015. bottomTex = "rbxassetid://152538557",
  1016. leftTex = "rbxassetid://71445924",
  1017. rightTex = "rbxassetid://71445924",
  1018. displayTex = "",
  1019. sound = "rbxassetid://507863457",
  1020. soundVol = 2,
  1021. hasGravity = false,
  1022. objectType = "Block"
  1023. }
  1024. --[[{
  1025. name = "Redstone",
  1026. size = Vector3.new(2.6, 0.05, 2.6),
  1027. transparency = 1;
  1028. frontTex = "rbxassetid://151911305",
  1029. backTex = "",
  1030. topTex = "rbxassetid://151911305",
  1031. bottomTex = "",
  1032. leftTex = "",
  1033. rightTex = "",
  1034. displayTex = "rbxassetid://64124418",
  1035. sound = "rbxassetid://1016978163",
  1036. soundVol = 2,
  1037. hasGravity = false,
  1038. objectType = "Redstone Dust"
  1039. },]]
  1040. }
  1041. function putInventorySlot(position, image, parent, zindex)
  1042. local button = Instance.new("TextButton", parent)
  1043. button.Position = position
  1044. button.Size = UDim2.new(0, 36, 0, 36)
  1045. button.BackgroundColor3 = Color3.new(139/255, 139/255, 139/255)
  1046. button.Text = ""
  1047. button.BorderSizePixel = 0
  1048. button.ZIndex = zindex
  1049. local imageLabel = Instance.new("ImageLabel", button)
  1050. imageLabel.BackgroundTransparency = 0.9
  1051. imageLabel.Position = UDim2.new(0, 2, 0, 2)
  1052. imageLabel.Size = UDim2.new(0, 32, 0, 32)
  1053. imageLabel.Image = image
  1054. imageLabel.BorderSizePixel = 0
  1055. imageLabel.ZIndex = zindex
  1056. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 34, 0, 2),
  1057. Color3.new(55/255, 55/255, 55/255), 0, button, zindex)
  1058. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 2, 0, 34),
  1059. Color3.new(55/255, 55/255, 55/255), 0, button, zindex)
  1060. makeSquare(UDim2.new(0, 34, 0, 2), UDim2.new(0, 2, 0, 34),
  1061. Color3.new(255/255, 255/255, 255/255), 0, button, zindex)
  1062. makeSquare(UDim2.new(0, 2, 0, 34), UDim2.new(0, 34, 0, 2),
  1063. Color3.new(255/255, 255/255, 255/255), 0, button, zindex)
  1064. return button
  1065. end
  1066. if player and player.Character.Humanoid.Health ~= 0 then
  1067. for i,v in pairs(game.Players:GetChildren()) do
  1068. coroutine.resume(coroutine.create(function()
  1069. local sc = Instance.new("ScreenGui",v.PlayerGui)
  1070. local frame = Instance.new("Frame",sc)
  1071. frame.Position = UDim2.new(0,0,0.796,0)
  1072. frame.Size = UDim2.new(0,518,0,112)
  1073. frame.BackgroundTransparency = 1
  1074. local textLabel = Instance.new("TextLabel",frame)
  1075. textLabel.Text = player.Name.." has joined the game."
  1076. textLabel.TextSize = 24
  1077. textLabel.Font = "Arcade"
  1078. textLabel.Size = UDim2.new(1,0,1,0)
  1079. textLabel.Position = UDim2.new(0,1,0,1)
  1080. textLabel.BackgroundTransparency = 0.5
  1081. textLabel.BackgroundColor3 = Color3.new(0, 0, 0)
  1082. textLabel.TextColor3 = Color3.new(255, 255, 0)
  1083. wait(5)
  1084. textLabel.Visible = false
  1085. end))
  1086. end
  1087. local char = player.Character
  1088. char:WaitForChild("Body Colors").HeadColor = BrickColor.new("Really black")
  1089. char:WaitForChild("Body Colors").TorsoColor = BrickColor.new("Really black")
  1090. char:WaitForChild("Body Colors").LeftArmColor = BrickColor.new("Really black")
  1091. char:WaitForChild("Body Colors").RightArmColor = BrickColor.new("Really black")
  1092. char:WaitForChild("Body Colors").LeftLegColor = BrickColor.new("Really black")
  1093. char:WaitForChild("Body Colors").RightLegColor = BrickColor.new("Really black")
  1094. coroutine.resume(coroutine.create(function()
  1095. for i,v in pairs(char:GetChildren()) do
  1096. if v.ClassName == "Shirt" then
  1097. v:remove()
  1098. v.Parent = nil
  1099. v:Destroy()
  1100. end
  1101. end
  1102. for i,v in pairs(char:GetChildren()) do
  1103. if v.ClassName == "Pants" then
  1104. v:remove()
  1105. v.Parent = nil
  1106. v:Destroy()
  1107. end
  1108. end
  1109. end))
  1110. --mas = char
  1111. damage = 10
  1112. local diedtofalldamage = false
  1113. local damageHeight = 10.4 -- The height at which the player will start getting damaged at
  1114. local lethalHeight = 59.8 -- The height at which the player will get killed
  1115.  
  1116. local root = char:WaitForChild("HumanoidRootPart")
  1117. local humanoid = char:WaitForChild("Humanoid")
  1118. Gravity = -2
  1119. humanoid.JumpPower = 25.11
  1120. BodyForce = Instance.new("BodyForce")
  1121. BodyForce.force = Vector3.new(0, (1-Gravity) * root:GetMass() * 236 / 1.2, 0)
  1122. BodyForce:clone().Parent = root
  1123.  
  1124. if humanoid and root then
  1125.  
  1126. local headHeight
  1127. humanoid.FreeFalling:Connect(function (state)
  1128. if state then
  1129. headHeight = root.Position.Y
  1130. elseif not state and headHeight ~= nil then
  1131. pcall(function ()
  1132.  
  1133. local fell = headHeight - root.Position.Y
  1134.  
  1135. if fell >= lethalHeight then
  1136. humanoid.Health = 0
  1137. diedtofalldamage = true
  1138. wait()
  1139. for i,v in pairs(game.Players:GetChildren()) do
  1140. if v.PlayerGui:FindFirstChild("TextLabel").Text == player.Name.. "Died" then
  1141. v:FindFirstChild("TextLabel").Text = player.Name.. "fell from a high place"
  1142. end
  1143. end
  1144. elseif fell >= damageHeight then
  1145. humanoid.Health = humanoid.Health - math.floor(fell)
  1146. end
  1147. end)
  1148. end
  1149. end)
  1150. end
  1151. minecrafttheme = Instance.new("Sound",char)
  1152. minecrafttheme.SoundId = "rbxassetid://4611987152"
  1153. minecrafttheme.Volume = 0.5
  1154. --minecrafttheme:Play()
  1155. minecrafttheme.Looped = true
  1156. minecrafttheme:Play()
  1157. Step1 = Instance.new("Sound",char.HumanoidRootPart)
  1158. Step1.SoundId = "rbxassetid://507863105"
  1159. Step1.Volume = 1
  1160. Step1.PlaybackSpeed = 1
  1161. Step2 = Instance.new("Sound",char.HumanoidRootPart)
  1162. Step2.SoundId = "rbxassetid://507863105"
  1163. Step2.Volume = 1
  1164. Step2.PlaybackSpeed = 1
  1165. char:FindFirstChildOfClass("Humanoid").DisplayDistanceType = "None"
  1166.  
  1167. if char then
  1168. local d = char:GetChildren()
  1169. for i=1, #d do
  1170. if (d[i].className == "Accessory") then
  1171. d[i]:remove()
  1172. end
  1173. if (d[i].className == "Hat") then
  1174. d[i]:remove()
  1175. end
  1176. end
  1177. Shirt0 = Instance.new("Shirt",char)
  1178. Pants1 = Instance.new("Pants",char)
  1179. Shirt0.ShirtTemplate = "rbxassetid://4666109142"
  1180. Pants1.PantsTemplate = "rbxassetid://4666111066"
  1181. local draggingBlock = nil
  1182. function makeInventory()
  1183. local playerGui = player:FindFirstChild("PlayerGui")
  1184. if playerGui then
  1185. local invGui = Instance.new("ScreenGui", playerGui)
  1186. local creativeInv = Instance.new("Frame", invGui)
  1187. creativeInv.BackgroundTransparency = 1
  1188. creativeInv.Position = UDim2.new(0.5, -170, 0.5, -202)
  1189.  
  1190. creativeInv.Visible = false
  1191.  
  1192. -- creative inventory GUI...
  1193.  
  1194. local blackOut = makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(1, 0, 1, 0),
  1195. Color3.new(0/255, 0/255, 0/255), 0.3, invGui, 1)
  1196. blackOut.Visible = false
  1197.  
  1198. creativeInv.Changed:connect(function()
  1199. blackOut.Visible = creativeInv.Visible
  1200. end)
  1201.  
  1202. local changeLog = Instance.new("TextLabel", invGui)
  1203. changeLog.Text = Changelog
  1204. changeLog.Font = "SourceSans"
  1205. changeLog.FontSize = Enum.FontSize.Size12
  1206. changeLog.Size = UDim2.new(0, changeLog.TextBounds.X, 0, changeLog.TextBounds.Y + 2)
  1207. changeLog.BackgroundColor3 = Color3.new(0, 0, 0)
  1208. changeLog.BorderSizePixel = 0
  1209. changeLog.BackgroundTransparency = 0.5
  1210. changeLog.Position = UDim2.new(0.5, -changeLog.Size.X.Offset/2, 0.5, -changeLog.Size.Y.Offset/2)
  1211. changeLog.TextColor3 = Color3.new(1, 1, 1)
  1212. changeLog.TextXAlignment = "Left"
  1213. changeLog.TextYAlignment = "Top"
  1214.  
  1215. local coolButton = Instance.new("TextButton", changeLog)
  1216. coolButton.Position = UDim2.new(1, -17, 0, 1)
  1217. coolButton.Size = UDim2.new(0, 16, 0, 12)
  1218. coolButton.Text = "X"
  1219. coolButton.Font = "SourceSans"
  1220. coolButton.FontSize = Enum.FontSize.Size12
  1221. coolButton.BorderSizePixel = 0
  1222. coolButton.BackgroundColor3 = Color3.new(1, 0, 0)
  1223. coolButton.BackgroundTransparency = 0.2
  1224. coolButton.TextColor3 = Color3.new(1, 1, 1)
  1225. coolButton.TextStrokeTransparency = 0.5
  1226. coolButton.ZIndex = 2
  1227.  
  1228. local line = makeSquare(UDim2.new(0, 0, 1, -14), UDim2.new(1, 0, 0, 14),
  1229. Color3.new(0, 0, 0), 0.75, changeLog, 2)
  1230.  
  1231. local line2 = makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(1, 0, 0, 14),
  1232. Color3.new(1, 1, 1), 0.9, changeLog, 1)
  1233.  
  1234. line2.Text = "Change Log"
  1235. line2.TextColor3 = Color3.new(1, 1, 1)
  1236. line2.TextStrokeTransparency = 0.75
  1237. line2.Font = "SourceSans"
  1238. line2.FontSize = Enum.FontSize.Size12
  1239.  
  1240. line.Text = "Made by Depr1 (Hes the original creator)"
  1241. line.TextColor3 = Color3.new(1, 0.65, 0)
  1242. line.TextStrokeTransparency = 0.5
  1243. line.Font = "SourceSans"
  1244. line.FontSize = Enum.FontSize.Size14
  1245. line.TextXAlignment = "Left"
  1246.  
  1247. coolButton.MouseButton1Click:connect(function()
  1248. changeLog.Visible = false
  1249. end)
  1250.  
  1251. makeSquare(UDim2.new(0, -2, 0, 2), UDim2.new(0, 340, 0, 404),
  1252. Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 3)
  1253. makeSquare(UDim2.new(0, 338, 0, 0), UDim2.new(0, 6, 0, 406),
  1254. Color3.new(85/255, 85/255, 85/255), 0, creativeInv, 2)
  1255. makeSquare(UDim2.new(0, 0, 0, 404), UDim2.new(0, 342, 0, 4),
  1256. Color3.new(85/255, 85/255, 85/255), 0, creativeInv, 3)
  1257. makeSquare(UDim2.new(0, 2, 0, 0), UDim2.new(0, 338, 0, 402),
  1258. Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 3)
  1259. makeSquare(UDim2.new(0, -4, 0, -2), UDim2.new(0, 4, 0, 406),
  1260. Color3.new(255/255, 255/255, 255/255), 0, creativeInv, 3)
  1261. makeSquare(UDim2.new(0, -2, 0, -4), UDim2.new(0, 342, 0, 6),
  1262. Color3.new(255/255, 255/255, 255/255), 0, creativeInv, 2)
  1263. makeSquare(UDim2.new(0, 340, 0, -2), UDim2.new(0, 2, 0, 2),
  1264. Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 2)
  1265. makeSquare(UDim2.new(0, 340, 0, -4), UDim2.new(0, 2, 0, 4),
  1266. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1267. makeSquare(UDim2.new(0, 342, 0, -2), UDim2.new(0, 2, 0, 2),
  1268. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1269. makeSquare(UDim2.new(0, 344, 0, 0), UDim2.new(0, 2, 0, 406),
  1270. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1271. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 2, 0, 4),
  1272. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1273. makeSquare(UDim2.new(0, -2, 0, -6), UDim2.new(0, 342, 0, 4),
  1274. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1275. makeSquare(UDim2.new(0, 0, 0, 406), UDim2.new(0, 342, 0, 4),
  1276. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1277. makeSquare(UDim2.new(0, 342, 0, 404), UDim2.new(0, 2, 0, 4),
  1278. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1279. makeSquare(UDim2.new(0, -4, 0, 404), UDim2.new(0, 2, 0, 2),
  1280. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1281. makeSquare(UDim2.new(0, -2, 0, 406), UDim2.new(0, 2, 0, 2),
  1282. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1283. makeSquare(UDim2.new(0, -6, 0, -2), UDim2.new(0, 2, 0, 406),
  1284. Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
  1285. 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)
  1286. text.Text = "Creative Inventory"
  1287. text.Font = "SourceSansSemibold"
  1288. text.TextSize = 14
  1289. text.TextXAlignment = "Left"
  1290. --
  1291. local draggingBlockPicture = Instance.new("ImageLabel", invGui)
  1292. draggingBlockPicture.BackgroundTransparency = 1
  1293. draggingBlockPicture.Size = UDim2.new(0, 32, 0, 32)
  1294. draggingBlockPicture.ZIndex = 5
  1295. coroutine.resume(coroutine.create(function()
  1296. local invMouse = player:GetMouse()
  1297. --local RS = game:GetService("RunService").RenderStepped
  1298. invMouse.Button2Down:connect(function()
  1299. draggingBlock = nil
  1300. end)
  1301. while RS:wait() do
  1302. --draggingBlockPicture.Position = UDim2.new(0, invMouse.X - 16, 0, invMouse.Y - 16)
  1303. if draggingBlock ~= nil then
  1304. draggingBlockPicture.Image = ""
  1305. else
  1306. draggingBlockPicture.Image = ""
  1307. end
  1308. end
  1309. end))
  1310.  
  1311. local done = false
  1312. local x = 0
  1313. local y = 0
  1314.  
  1315. for i,b in pairs(creativeInventory) do
  1316. local display = ""
  1317. if b.displayTex == "" then
  1318. display = b.frontTex
  1319. else
  1320. if b.displayTex then
  1321. display = b.displayTex
  1322. end
  1323. end
  1324. putInventorySlot(UDim2.new(0.5, (x*36) + 8, 0.5, (y*36) + 28), display, creativeInv, 4).MouseButton1Down:connect(function()
  1325. if draggingBlock == nil then
  1326. draggingBlock = b
  1327. end
  1328. end)
  1329. x = x + 1
  1330. if x >= 8 then
  1331. x = 0
  1332. y = y + 1
  1333. end
  1334. end
  1335. if x == 0 then done = true end
  1336. while x < 8 and done == false do
  1337. putInventorySlot(UDim2.new(0.5, (x*36) + 8, 0.5, (y*36) + 28), "", creativeInv, 4)
  1338. x = x + 1
  1339. end
  1340. for i = 1, 9 do
  1341. if toolBar[i] ~= nil then
  1342. local invSlot = putInventorySlot(UDim2.new(0, 8 + ((i-1)*36), 0, 360), toolBar[i].frontTex, creativeInv, 4)
  1343. invSlot.MouseButton2Down:connect(function()
  1344. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  1345. if imgLabel then
  1346. toolBar[i] = nil
  1347. imgLabel.Image = ""
  1348. end
  1349. end)
  1350. invSlot.MouseButton1Down:connect(function()
  1351. --updateHand = true
  1352. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  1353. if toolBar[i] == nil then
  1354. toolBar[i] = draggingBlock
  1355. imgLabel.Image = draggingBlock.frontTex
  1356. draggingBlock = nil
  1357. return
  1358. end
  1359. if toolBar[i] ~= nil and draggingBlock == nil then
  1360. draggingBlock = toolBar[i]
  1361. toolBar[i] = nil
  1362. imgLabel.Image = ""
  1363. return
  1364. elseif toolBar[i] ~= nil and draggingBlock ~= nil then
  1365. --draggingBlock = toolBar[i]
  1366. --toolBar[i] = nil
  1367. imgLabel.Image = ""
  1368. local temp = toolBar[i]
  1369. toolBar[i] = draggingBlock
  1370. if imgLabel and draggingBlock ~= nil then
  1371. imgLabel.Image = draggingBlock.frontTex
  1372. end
  1373. if imgLabel and draggingBlock == nil then
  1374. imgLabel.Image = ""
  1375. end
  1376. draggingBlock = temp
  1377. return
  1378. end
  1379. end)
  1380. else
  1381. local invSlot = putInventorySlot(UDim2.new(0, 8 + ((i-1)*36), 0, 360), "", creativeInv, 4)
  1382. invSlot.MouseButton2Down:connect(function()
  1383. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  1384. if imgLabel then
  1385. toolBar[i] = nil
  1386. imgLabel.Image = ""
  1387. end
  1388. end)
  1389. invSlot.MouseButton1Down:connect(function()
  1390. --updateHand = true
  1391. local imgLabel = invSlot:FindFirstChild("ImageLabel")
  1392. if toolBar[i] == nil then
  1393. toolBar[i] = draggingBlock
  1394. imgLabel.Image = draggingBlock.frontTex
  1395. draggingBlock = nil
  1396. return
  1397. end
  1398. if toolBar[i] ~= nil and draggingBlock == nil then
  1399. draggingBlock = toolBar[i]
  1400. toolBar[i] = nil
  1401. imgLabel.Image = ""
  1402. return
  1403. elseif toolBar[i] ~= nil and draggingBlock ~= nil then
  1404. --draggingBlock = toolBar[i]
  1405. --toolBar[i] = nil
  1406. imgLabel.Image = ""
  1407. local temp = toolBar[i]
  1408. toolBar[i] = draggingBlock
  1409. if imgLabel and draggingBlock ~= nil then
  1410. imgLabel.Image = draggingBlock.frontTex
  1411. end
  1412. if imgLabel and draggingBlock == nil then
  1413. imgLabel.Image = ""
  1414. end
  1415. draggingBlock = temp
  1416. return
  1417. end
  1418. end)
  1419. end
  1420. end
  1421. return creativeInv
  1422. end
  1423. end
  1424.  
  1425.  
  1426. --[]
  1427. local gui = player.PlayerGui:FindFirstChild("ToolBar") or Instance.new("ScreenGui", player.PlayerGui)
  1428. gui.Name = "ToolBar"
  1429.  
  1430. makeSquare(UDim2.new(0.5, -166, 1, -111), UDim2.new(0, 364, 0, 44),
  1431. Color3.new(0/255, 0/255, 0/255), 0, gui)
  1432.  
  1433. local blocks = {"Dirt", "Grass", "Stone", "Diamond_Ore", "Diamond_Block", "Wood_Planks", "Oak_Log"}
  1434. for i = 1, 9 do
  1435. if toolBar[blocks[i]] ~= nil then
  1436. putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), toolBar[blocks[i]].frontTex)
  1437. else
  1438. putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), "")
  1439. end
  1440. end
  1441.  
  1442. for i = 1, 9 do
  1443. if toolBar[i] ~= nil then
  1444. local img = putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), toolBar[i].frontTex)
  1445. coroutine.resume(coroutine.create(function()
  1446. while wait() do
  1447. if toolBar[i] ~= nil then
  1448. if toolBar[i].displayTex == "" then
  1449. img.Image = toolBar[i].frontTex
  1450. else
  1451. img.Image = toolBar[i].displayTex
  1452. end
  1453. else
  1454. img.Image = ""
  1455. end
  1456. end
  1457. end))
  1458. else
  1459. local img = putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), "")
  1460. coroutine.resume(coroutine.create(function()
  1461. while wait() do
  1462. if toolBar[i] ~= nil then
  1463. if toolBar[i].displayTex == "" then
  1464. img.Image = toolBar[i].frontTex
  1465. else
  1466. img.Image = toolBar[i].displayTex
  1467. end
  1468. else
  1469. img.Image = ""
  1470. end
  1471. end
  1472. end))
  1473. end
  1474. end
  1475. local creativeInventoryGUI = makeInventory()
  1476.  
  1477. local humRootPart = char:WaitForChild("HumanoidRootPart")
  1478. local head = char:WaitForChild("Head")
  1479. local torso = char:WaitForChild("Torso")
  1480. local lArm = char:WaitForChild("Left Arm")
  1481. local rArm = char:WaitForChild("Right Arm")
  1482. local lLeg = char:WaitForChild("Left Leg")
  1483. local rLeg = char:WaitForChild("Right Leg")
  1484. head.Size = Vector3.new(1.3, 1.3, 1.3)
  1485. head:WaitForChild("Mesh"):Destroy()
  1486. head:WaitForChild("face"):Destroy()
  1487.  
  1488. local camera = workspace.CurrentCamera
  1489.  
  1490. local camPart = Instance.new("Part", camera)
  1491. camPart.Name = "CamPart Local"
  1492. camPart.Size = Vector3.new(0, 0, 0)
  1493. camPart.CFrame = camera.CFrame
  1494. camPart.CanCollide = false
  1495. camPart.Anchored = true
  1496. camPart.Transparency = 1
  1497. headdecal6 = Instance.new("Decal",head)
  1498. headdecal6.Face = "Front"
  1499. headdecal6.Texture = faces[math.random(1,#faces)]
  1500. if headdecal6.Texture == "http://www.roblox.com/asset/?id=4823712466" then
  1501. local hit0 = Instance.new("Part", char)
  1502. hit0.Name = "DamagePart"
  1503. hit0.BrickColor = BrickColor.new("Bright red")
  1504. hit0.Material = "SmoothPlastic"
  1505. hit0.Transparency = 1
  1506. hit0.Size = Vector3.new(lArm.Size.X + 0.001, lArm.Size.Y + 0.001, lArm.Size.Z + 0.001)
  1507. hit0.CanCollide = false
  1508. weldd = Instance.new("Weld",hit0)
  1509. weldd.Part0 = lArm
  1510. weldd.Part1 = hit0
  1511. local hit1 = Instance.new("Part", char)
  1512. hit1.Name = "DamagePart"
  1513. hit1.BrickColor = BrickColor.new("Bright red")
  1514. hit1.Material = "SmoothPlastic"
  1515. hit1.Transparency = 1
  1516. hit1.Size = Vector3.new(rArm.Size.X + 0.001, rArm.Size.Y + 0.001, rArm.Size.Z + 0.001)
  1517. hit1.CanCollide = false
  1518. welddd = Instance.new("Weld",hit1)
  1519. welddd.Part0 = rArm
  1520. welddd.Part1 = hit1
  1521.  
  1522. torso.Size = Vector3.new(1.3, 1.95, 0.65)
  1523. lArm.Size = Vector3.new(0.65, 1.95, 0.65)
  1524. rArm.Size = Vector3.new(0.65, 1.95, 0.65)
  1525. lLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  1526. rLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  1527. lS = Instance.new("Motor6D", torso)
  1528. lS.Name = "Left Shoulder"
  1529. lS.Part0 = lArm
  1530. lS.Part1 = torso
  1531. lS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  1532. lS.C1 = CFrame.new(1.3, 0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  1533.  
  1534. rS = Instance.new("Motor6D", torso)
  1535. rS.Name = "Right Shoulder"
  1536. rS.Part0 = rArm
  1537. rS.Part1 = torso
  1538. rS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  1539. rS.C1 = CFrame.new(-0.65, 0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  1540.  
  1541. char.Humanoid:ClearAllChildren()
  1542. --char.Animate:Remove()
  1543. for _,cM in pairs(char:GetChildren()) do
  1544. if cM.ClassName == "CharacterMesh" and cM.Name ~= "cl" then cM:Destroy() end
  1545. end
  1546. cl = Instance.new("CharacterMesh",char)
  1547. cl.MeshId = 1112256772
  1548. cl.BodyPart = "LeftArm"
  1549. cl.Name = "cl"
  1550. clcl = Instance.new("CharacterMesh",char)
  1551. clcl.MeshId = 1112275294
  1552. clcl.BodyPart = "LeftLeg"
  1553. clcl.Name = "cl"
  1554. clclcl = Instance.new("CharacterMesh",char)
  1555. clclcl.MeshId = 1112244824
  1556. clclcl.BodyPart = "RightArm"
  1557. clclcl.Name = "cl"
  1558. clclclcl = Instance.new("CharacterMesh",char)
  1559. clclclcl.MeshId = 1112267576
  1560. clclclcl.BodyPart = "RightLeg"
  1561. clclclcl.Name = "cl"
  1562. clclclclcl = Instance.new("CharacterMesh",char)
  1563. clclclclcl.MeshId = 1112228624
  1564. clclclclcl.BodyPart = "Torso"
  1565. clclclclcl.Name = "cl"
  1566. end
  1567. for _,p in pairs(char:GetChildren()) do
  1568. if p.ClassName == "Part" and p.Name ~= "DamagePart" and p.Name ~= "Diamond Sword" and p.Name ~= "HandItem" and p.Name ~= "HumanoidRootPart" and p.Name ~= "Left Arm" and p.Name ~= "Right Arm" then
  1569. local hit = Instance.new("Part", char)
  1570. hit.Name = "DamagePart"
  1571. hit.BrickColor = BrickColor.new("Bright red")
  1572. hit.Material = "SmoothPlastic"
  1573. hit.Transparency = 1
  1574. hit.Size = Vector3.new(p.Size.X + 0.001, p.Size.Y + 0.001, p.Size.Z + 0.001)
  1575. hit.CanCollide = false
  1576. weld = Instance.new("Weld",p)
  1577. weld.Part0 = p
  1578. weld.Part1 = hit
  1579. end
  1580. end
  1581. coroutine.resume(coroutine.create(function()
  1582. player = game.Players.LocalPlayer
  1583. char = player.Character
  1584. billnametag = Instance.new("BillboardGui",char.Head)
  1585. billnametag.StudsOffset = Vector3.new(0,1.5,0)
  1586. billnametag.ZIndexBehavior = "Global"
  1587. billnametag.LightInfluence = 1
  1588. billnametag.MaxDistance = math.huge
  1589. billnametag.AlwaysOnTop = true
  1590. frame = Instance.new("Frame",billnametag)
  1591. frame.AnchorPoint = Vector2.new(0, 0)
  1592. frame.Size = UDim2.new(1,0,1,0)
  1593. frame.BackgroundTransparency = 1
  1594. frame.BackgroundColor3 = Color3.new(0,0,0)
  1595. frame.Position = UDim2.new(0,0,0,0)
  1596. --billnametag.PlayerToHideFrom = player
  1597. textlabel = Instance.new("TextLabel",frame)
  1598. --textlabel.BorderSizePixel = 0
  1599. textlabel.Font = "Arcade"
  1600. textlabel.Size = UDim2.new(1,0,1,0)
  1601. textlabel.Position = UDim2.new(0,1,0,1)
  1602. textlabel.Text = player.Name
  1603. textlabel.BackgroundColor3 = Color3.new(0,0,0)
  1604. textlabel.TextColor3 = Color3.fromRGB(255,255,255)
  1605. textlabel.BackgroundTransparency = 0.5
  1606. textlabel.AnchorPoint = Vector2.new(0,0)
  1607. --textlabel.ClipsDescendants = true
  1608. --textlabel.TextScaled = true
  1609. textlabel.TextSize = 20
  1610. billnametag.Size = UDim2.new(textlabel.TextBounds.X/100, 0, 0.75, 0)
  1611. frame.Size = UDim2.new(textlabel.TextBounds.X/100, 0, 0.75, 0)
  1612. billnametag.SizeOffset = Vector2.new(-textlabel.TextBounds.X/200 + 0.5, 0)
  1613. if player.Name == "ManSolomon" or player.Name == "noah878788" then
  1614. textlabel.TextColor3 = Color3.fromRGB(255, 255, 0)
  1615. end
  1616. if player.Name == "guest712921" then
  1617. textlabel.TextColor3 = Color3.fromRGB(255, 255, 0)
  1618. textlabel.Text = textlabel.Text.. " (BETA TESTER!!!)"
  1619. frame.Size = UDim2.new(textlabel.TextBounds.X/100, 0, 0.75, 0)
  1620. billnametag.SizeOffset = Vector2.new(-textlabel.TextBounds.X/200 + 0.5, 0)
  1621. while true do
  1622. i = 0
  1623. for n=1,0,-0.05 do
  1624. i = i + 0.05
  1625. textlabel.TextColor3 = Color3.new(i, 0, n)
  1626. wait()
  1627. end
  1628. i = 0
  1629. for n=1,0,-0.05 do
  1630. i = i + 0.05
  1631. textlabel.TextColor3 = Color3.new(n, i, 0)
  1632. wait()
  1633. end
  1634. i = 0
  1635. for n=1,0,-0.05 do
  1636. i = i + 0.05
  1637. textlabel.TextColor3 = Color3.new(0, n, i)
  1638. wait()
  1639. end
  1640. end
  1641. end
  1642. wait()
  1643. textlabel.TextScaled = true
  1644. textlabel.TextSize = 8
  1645. end))
  1646.  
  1647. -- now for the real stuff
  1648. -- |
  1649. -- |
  1650. -- V
  1651.  
  1652.  
  1653. local Mouse = player:GetMouse()
  1654.  
  1655.  
  1656. --[[local cameraHand = Instance.new("Part", camera)
  1657. cameraHand.Size = Vector3.new(0.65, 1.95, 0.65)
  1658. cameraHand.CanCollide = false
  1659. cameraHand.Anchored = true
  1660. cameraHand.Name = "CameraHand"
  1661.  
  1662. local cameraHandWeld = Instance.new("Motor6D", camPart)
  1663. cameraHandWeld.Part0 = camPart
  1664. cameraHandWeld.Part1 = cameraHand
  1665. cameraHandWeld.C0 = CFrame.new(5, 0, 0)
  1666. ]]--
  1667.  
  1668. local humanoid = char:WaitForChild("Humanoid")
  1669.  
  1670. -- Heart bar
  1671. local hpFrame = makeSquare(UDim2.new(0.5, -166, 1, -130), UDim2.new(0, 162, 0, 18),
  1672. Color3.new(0/255, 0/255, 0/255), 1, gui, 1)
  1673.  
  1674. local hearts = makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 162, 0, 18),
  1675. Color3.new(0/255, 0/255, 0/255), 1, hpFrame, 1)
  1676. hearts.ClipsDescendants = true
  1677.  
  1678. for i = 1, 10 do
  1679. local heartImg = makeImage(UDim2.new(0, (i-1)*16, 0, 0), UDim2.new(0, 18, 0, 18),
  1680. "rbxassetid://1494233443", hearts, 2)
  1681.  
  1682. makeSquare(UDim2.new(0, 4, 0, 4), UDim2.new(0, 2, 0, 2),
  1683. Color3.new(255/255, 200/255, 200/255), 0, heartImg, 2)
  1684.  
  1685. heartImg.ImageColor3 = Color3.new(240/255, 0, 0)
  1686.  
  1687. local emptyHeart = makeImage(UDim2.new(0, (i-1)*16, 0, 0), UDim2.new(0, 18, 0, 18),
  1688. "rbxassetid://1494233443", hpFrame, 1)
  1689. emptyHeart.ImageColor3 = Color3.new(0.3, 0.3, 0.3)
  1690.  
  1691. local outline = makeImage(UDim2.new(0, 0, 0, 0), UDim2.new(0, 18, 0, 18),
  1692. "rbxassetid://1494176679", emptyHeart, 1)
  1693. outline.ImageColor3 = Color3.new(0, 0, 0)
  1694.  
  1695. local oldHP = humanoid.Health/humanoid.MaxHealth --SnapToGrid((humanoid.Health/humanoid.MaxHealth)*162, 8)
  1696. humanoid.Changed:connect(function()
  1697. local hp = humanoid.Health/humanoid.MaxHealth --SnapToGrid((humanoid.Health/humanoid.MaxHealth)*162, 8)
  1698. if SnapToGrid(oldHP*162, 8) < SnapToGrid(hp*162, 8) then
  1699. outline.ImageColor3 = Color3.new(1, 1, 1)
  1700. wait(0.1)
  1701. outline.ImageColor3 = Color3.new(0, 0, 0)
  1702. wait(0.1)
  1703. end
  1704. if oldHP > hp then
  1705. for i = 1, 2 do
  1706. outline.ImageColor3 = Color3.new(1, 1, 1)
  1707. wait(0.1)
  1708. outline.ImageColor3 = Color3.new(0, 0, 0)
  1709. wait(0.1)
  1710. end
  1711. end
  1712. oldHP = hp
  1713. end)
  1714. coroutine.resume(coroutine.create(function()
  1715. local yIncrease = 0
  1716. local originalY = emptyHeart.Position.Y.Offset
  1717.  
  1718. while wait() do
  1719. if humanoid.Health/humanoid.MaxHealth <= 0.27 then
  1720. if yIncrease <= 0 then
  1721. yIncrease = math.random(1, 2)
  1722. else
  1723. yIncrease = yIncrease - 1
  1724. end
  1725.  
  1726. heartImg.Position = UDim2.new(0, heartImg.Position.X.Offset, 0, -yIncrease)
  1727. emptyHeart.Position = UDim2.new(0, emptyHeart.Position.X.Offset, 0, -yIncrease)
  1728. else
  1729. if yIncrease >= 1 then
  1730. yIncrease = yIncrease - 1
  1731.  
  1732. heartImg.Position = UDim2.new(0, heartImg.Position.X.Offset, 0, -yIncrease)
  1733. emptyHeart.Position = UDim2.new(0, emptyHeart.Position.X.Offset, 0, -yIncrease)
  1734. end
  1735. end
  1736. end
  1737. end))
  1738. end
  1739.  
  1740.  
  1741. humanoid.BreakJointsOnDeath = false
  1742. humanoid.HipHeight = 0.3
  1743.  
  1744. local rootJoint = Instance.new("Motor6D", torso)
  1745. rootJoint.Name = "RootJoint"
  1746. rootJoint.Part0 = humRootPart
  1747. rootJoint.Part1 = torso
  1748. rootJoint.C1 = CFrame.new(0, 0.05, 0)
  1749. remoteevent = Instance.new("RemoteEvent",char)
  1750. remoteevent.Name = "SteveFunction"
  1751. local neck = torso:WaitForChild("Neck")
  1752. neck.Name = "Neck"
  1753. neck.Part0 = head
  1754. neck.Part1 = torso
  1755. remoteevent.OnServerEvent:Connect(function(plr,a,b)
  1756. necka = plr.Character.Torso.Neck
  1757. necka.C0 = a
  1758. necka.C1 = b
  1759. end)
  1760. NLS([[
  1761. -- NOTE (READ!!): This script doesn't work on voidacity's script builder
  1762. -- since it crashes your game, but it's usable on other
  1763. -- script builders like fancy dev's or nexure's.
  1764. -- (it just doesn't work on voidacity only)
  1765.  
  1766. -- Scroll down for changelog...
  1767.  
  1768. -- ORIGINAL CREATOR: Depr1
  1769.  
  1770. -- If this script isn't on pastebin or the user who uploaded this isn't called "Delros12"
  1771. -- (and yes my pastebin account is Delros12) or the link is not https://pastebin.com/2NNDTLjL
  1772. -- then this is not the original link of this script.
  1773.  
  1774. -- The original link of the script gets edited constantly for updates, if you use the original
  1775. -- link you will be able to enjoy the most recent updates of this script without changing to
  1776. -- another link which contains updated script.
  1777.  
  1778. -- Controls: Q to sneak, use the keypad numbers 1-9 to change blocks,
  1779. -- choose a empty slot if you want to remove a block, E to open creative
  1780. -- inventory, right-click to destroy a block in your toolbar in creative
  1781. -- inventory, R to make camera face your character's front or back.
  1782.  
  1783. -- You will become steve when you use this script, if you die after
  1784. -- using this script, keep trying to use it or wait 60 seconds
  1785. -- (it doesn't work at first but eventually it will)
  1786.  
  1787. -- Enjoy! :)
  1788.  
  1789. local updateHand = false
  1790.  
  1791. workspace:WaitForChild("Camera"):ClearAllChildren()
  1792. local RS = game:GetService("RunService").RenderStepped
  1793. local targetName = game.Players.LocalPlayer.Name
  1794. local player = owner
  1795.  
  1796.  
  1797. function putTexture(part, frontF, backF, topF, bottomF, leftF, rightF, className)
  1798. local faces = {"Front", "Back", "Top", "Bottom", "Left", "Right"}
  1799. for i,f in pairs(faces) do
  1800. local decal = Instance.new(className, part)
  1801. if i == 1 then decal.Texture = frontF decal.Name = f end
  1802. if i == 2 then decal.Texture = backF or frontF decal.Name = f end
  1803. if i == 3 then decal.Texture = topF or frontF decal.Name = f end
  1804. if i == 4 then decal.Texture = bottomF or frontF decal.Name = f end
  1805. if i == 5 then decal.Texture = leftF or frontF decal.Name = f end
  1806. if i == 6 then decal.Texture = rightF or frontF decal.Name = f end
  1807. decal.Face = f
  1808. end
  1809. return part
  1810. end
  1811. function makeSquare(position, size, color, transparency, parent, zindex)
  1812. local label = Instance.new("TextLabel", parent)
  1813. label.Text = ""
  1814. label.BorderSizePixel = 0
  1815. label.BackgroundTransparency = transparency
  1816. label.Position = position
  1817. label.Size = size
  1818. label.BackgroundColor3 = color
  1819. if zindex == nil then label.ZIndex = 1 else label.ZIndex = zindex end
  1820. return label
  1821. end
  1822. function makeImage(position, size, image, parent, zindex)
  1823. local imglabel = Instance.new("ImageLabel", parent)
  1824. imglabel.BorderSizePixel = 0
  1825. imglabel.BackgroundTransparency = 1
  1826. imglabel.Position = position
  1827. imglabel.Size = size
  1828. imglabel.Image = image
  1829. if zindex == nil then imglabel.ZIndex = 1 else imglabel.ZIndex = zindex end
  1830. return imglabel
  1831. end
  1832. function putInventorySlot(position, image, parent, zindex)
  1833. local button = Instance.new("TextButton", parent)
  1834. button.Position = position
  1835. button.Size = UDim2.new(0, 36, 0, 36)
  1836. button.BackgroundColor3 = Color3.new(139/255, 139/255, 139/255)
  1837. button.Text = ""
  1838. button.BorderSizePixel = 0
  1839. button.ZIndex = zindex
  1840. local imageLabel = Instance.new("ImageLabel", button)
  1841. imageLabel.BackgroundTransparency = 0.9
  1842. imageLabel.Position = UDim2.new(0, 2, 0, 2)
  1843. imageLabel.Size = UDim2.new(0, 32, 0, 32)
  1844. imageLabel.Image = image
  1845. imageLabel.BorderSizePixel = 0
  1846. imageLabel.ZIndex = zindex
  1847. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 34, 0, 2),
  1848. Color3.new(55/255, 55/255, 55/255), 0, button, zindex)
  1849. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 2, 0, 34),
  1850. Color3.new(55/255, 55/255, 55/255), 0, button, zindex)
  1851. makeSquare(UDim2.new(0, 34, 0, 2), UDim2.new(0, 2, 0, 34),
  1852. Color3.new(255/255, 255/255, 255/255), 0, button, zindex)
  1853. makeSquare(UDim2.new(0, 2, 0, 34), UDim2.new(0, 34, 0, 2),
  1854. Color3.new(255/255, 255/255, 255/255), 0, button, zindex)
  1855. return button
  1856. end
  1857.  
  1858. function AngleDifference(Angle1, Angle2)
  1859. local Difference = {X = 0, Y = 0, Z = 0}
  1860. Difference.X = Angle2.X - Angle1.X
  1861.  
  1862. if (Difference.X > 180) then
  1863. Difference.X = Difference.X - 360
  1864. elseif (Difference.X < -180) then
  1865. Difference.X = Difference.X + 360
  1866. end
  1867.  
  1868. Difference.Y = Angle2.Y - Angle1.Y
  1869.  
  1870. if (Difference.Y > 180) then
  1871. Difference.Y = Difference.Y - 360
  1872. elseif (Difference.Y < -180) then
  1873. Difference.Y = Difference.Y + 360
  1874. end
  1875.  
  1876. Difference.Z = Angle2.Z - Angle1.Z
  1877.  
  1878. if (Difference.Z > 180) then
  1879. Difference.Z = Difference.Z - 360
  1880. elseif (Difference.Z < -180) then
  1881. Difference.Z = Difference.Z + 360
  1882. end
  1883.  
  1884. return Vector3.new(Difference.X, Difference.Y, Difference.Z)
  1885. end
  1886. local creativeInventory = {
  1887. {
  1888. name = "Dirt",
  1889. size = Vector3.new(2.6, 2.6, 2.6),
  1890. transparency = 0;
  1891. frontTex = "rbxassetid://152569532",
  1892. backTex = "rbxassetid://152569532",
  1893. topTex = "rbxassetid://152569532",
  1894. bottomTex = "rbxassetid://152569532",
  1895. leftTex = "rbxassetid://152569532",
  1896. rightTex = "rbxassetid://152569532",
  1897. displayTex = "",
  1898. sound = "rbxassetid://1102186681",
  1899. soundVol = 1.25,
  1900. hasGravity = false,
  1901. objectType = "Block"
  1902. },
  1903. {
  1904. name = "Grass",
  1905. size = Vector3.new(2.6, 2.6, 2.6),
  1906. transparency = 0;
  1907. frontTex = "rbxassetid://96430337",
  1908. backTex = "rbxassetid://96430337",
  1909. topTex = "rbxassetid://96430265",
  1910. bottomTex = "rbxassetid://179655033",
  1911. leftTex = "rbxassetid://96430337",
  1912. rightTex = "rbxassetid://96430337",
  1913. displayTex = "",
  1914. sound = "rbxassetid://1102186681",
  1915. soundVol = 1.25,
  1916. hasGravity = false,
  1917. objectType = "Block"
  1918. },
  1919. {
  1920. name = "Sand",
  1921. size = Vector3.new(2.6, 2.6, 2.6),
  1922. transparency = 0;
  1923. frontTex = "rbxassetid://347007448",
  1924. backTex = "rbxassetid://347007448",
  1925. topTex = "rbxassetid://347007448",
  1926. bottomTex = "rbxassetid://347007448",
  1927. leftTex = "rbxassetid://347007448",
  1928. rightTex = "rbxassetid://347007448",
  1929. displayTex = "",
  1930. sound = "rbxassetid://1102186681",
  1931. soundVol = 1.25,
  1932. hasGravity = true,
  1933. objectType = "Block"
  1934. },
  1935. {
  1936. name = "Gravel",
  1937. size = Vector3.new(2.6, 2.6, 2.6),
  1938. transparency = 0;
  1939. frontTex = "rbxassetid://151701568",
  1940. backTex = "rbxassetid://151701568",
  1941. topTex = "rbxassetid://151701568",
  1942. bottomTex = "rbxassetid://151701568",
  1943. leftTex = "rbxassetid://151701568",
  1944. rightTex = "rbxassetid://151701568",
  1945. displayTex = "",
  1946. sound = "rbxassetid://1102186681",
  1947. soundVol = 1.25,
  1948. hasGravity = true,
  1949. objectType = "Block"
  1950. },
  1951. {
  1952. name = "Stone",
  1953. size = Vector3.new(2.6, 2.6, 2.6),
  1954. transparency = 0;
  1955. frontTex = "rbxassetid://75880927",
  1956. backTex = "rbxassetid://75880927",
  1957. topTex = "rbxassetid://75880927",
  1958. bottomTex = "rbxassetid://75880927",
  1959. leftTex = "rbxassetid://75880927",
  1960. rightTex = "rbxassetid://75880927",
  1961. displayTex = "",
  1962. sound = "rbxassetid://1016978163",
  1963. soundVol = 2,
  1964. hasGravity = false,
  1965. objectType = "Block"
  1966. },
  1967. {
  1968. name = "Diamond Ore",
  1969. size = Vector3.new(2.6, 2.6, 2.6),
  1970. transparency = 0;
  1971. frontTex = "rbxassetid://57928490",
  1972. backTex = "rbxassetid://57928490",
  1973. topTex = "rbxassetid://57928490",
  1974. bottomTex = "rbxassetid://57928490",
  1975. leftTex = "rbxassetid://57928490",
  1976. rightTex = "rbxassetid://57928490",
  1977. displayTex = "",
  1978. sound = "rbxassetid://1016978163",
  1979. soundVol = 2,
  1980. hasGravity = false,
  1981. objectType = "Block"
  1982. },
  1983. {
  1984. name = "Diamond Block",
  1985. size = Vector3.new(2.6, 2.6, 2.6),
  1986. transparency = 0;
  1987. frontTex = "rbxassetid://56749955",
  1988. backTex = "rbxassetid://56749955",
  1989. topTex = "rbxassetid://56749955",
  1990. bottomTex = "rbxassetid://56749955",
  1991. leftTex = "rbxassetid://56749955",
  1992. rightTex = "rbxassetid://56749955",
  1993. displayTex = "",
  1994. sound = "rbxassetid://1016978163",
  1995. soundVol = 2,
  1996. hasGravity = false,
  1997. objectType = "Block"
  1998. },
  1999. {
  2000. name = "Emerald Block",
  2001. size = Vector3.new(2.6, 2.6, 2.6),
  2002. transparency = 0;
  2003. frontTex = "rbxassetid://152410853",
  2004. backTex = "rbxassetid://152410853",
  2005. topTex = "rbxassetid://152410853",
  2006. bottomTex = "rbxassetid://152410853",
  2007. leftTex = "rbxassetid://152410853",
  2008. rightTex = "rbxassetid://152410853",
  2009. displayTex = "",
  2010. sound = "rbxassetid://1016978163",
  2011. soundVol = 2,
  2012. hasGravity = false,
  2013. objectType = "Block"
  2014. },
  2015. {
  2016. name = "Emerald Ore",
  2017. size = Vector3.new(2.6, 2.6, 2.6),
  2018. transparency = 0;
  2019. frontTex = "rbxassetid://152410868",
  2020. backTex = "rbxassetid://152410868",
  2021. topTex = "rbxassetid://152410868",
  2022. bottomTex = "rbxassetid://152410868",
  2023. leftTex = "rbxassetid://152410868",
  2024. rightTex = "rbxassetid://152410868",
  2025. displayTex = "",
  2026. sound = "rbxassetid://1016978163",
  2027. soundVol = 2,
  2028. hasGravity = false,
  2029. objectType = "Block"
  2030. },
  2031. {
  2032. name = "Obsidian",
  2033. size = Vector3.new(2.6, 2.6, 2.6),
  2034. transparency = 0;
  2035. frontTex = "rbxassetid://112560322",
  2036. backTex = "rbxassetid://112560322",
  2037. topTex = "rbxassetid://112560322",
  2038. bottomTex = "rbxassetid://112560322",
  2039. leftTex = "rbxassetid://112560322",
  2040. rightTex = "rbxassetid://112560322",
  2041. displayTex = "",
  2042. sound = "rbxassetid://1016978163",
  2043. soundVol = 2,
  2044. hasGravity = false,
  2045. objectType = "Block"
  2046. },
  2047. {
  2048. name = "Gold Block",
  2049. size = Vector3.new(2.6, 2.6, 2.6),
  2050. transparency = 0;
  2051. frontTex = "rbxassetid://152572128",
  2052. backTex = "rbxassetid://152572128",
  2053. topTex = "rbxassetid://152572128",
  2054. bottomTex = "rbxassetid://152572128",
  2055. leftTex = "rbxassetid://152572128",
  2056. rightTex = "rbxassetid://152572128",
  2057. displayTex = "",
  2058. sound = "rbxassetid://1016978163",
  2059. soundVol = 2,
  2060. hasGravity = false,
  2061. objectType = "Block"
  2062. },
  2063. {
  2064. name = "Gold Ore",
  2065. size = Vector3.new(2.6, 2.6, 2.6),
  2066. transparency = 0;
  2067. frontTex = "rbxassetid://152572121",
  2068. backTex = "rbxassetid://152572121",
  2069. topTex = "rbxassetid://152572121",
  2070. bottomTex = "rbxassetid://152572121",
  2071. leftTex = "rbxassetid://152572121",
  2072. rightTex = "rbxassetid://152572121",
  2073. displayTex = "",
  2074. sound = "rbxassetid://1016978163",
  2075. soundVol = 2,
  2076. hasGravity = false,
  2077. objectType = "Block"
  2078. },
  2079. {
  2080. name = "Iron Block",
  2081. size = Vector3.new(2.6, 2.6, 2.6),
  2082. transparency = 0;
  2083. frontTex = "rbxassetid://152572134",
  2084. backTex = "rbxassetid://152572134",
  2085. topTex = "rbxassetid://152572134",
  2086. bottomTex = "rbxassetid://152572134",
  2087. leftTex = "rbxassetid://152572134",
  2088. rightTex = "rbxassetid://152572134",
  2089. displayTex = "",
  2090. sound = "rbxassetid://1016978163",
  2091. soundVol = 2,
  2092. hasGravity = false,
  2093. objectType = "Block"
  2094. },
  2095. {
  2096. name = "Iron Ore",
  2097. size = Vector3.new(2.6, 2.6, 2.6),
  2098. transparency = 0;
  2099. frontTex = "rbxassetid://132879562",
  2100. backTex = "rbxassetid://132879562",
  2101. topTex = "rbxassetid://132879562",
  2102. bottomTex = "rbxassetid://132879562",
  2103. leftTex = "rbxassetid://132879562",
  2104. rightTex = "rbxassetid://132879562",
  2105. displayTex = "",
  2106. sound = "rbxassetid://1016978163",
  2107. soundVol = 2,
  2108. hasGravity = false,
  2109. objectType = "Block"
  2110. },
  2111. {
  2112. name = "Redstone Block",
  2113. size = Vector3.new(2.6, 2.6, 2.6),
  2114. transparency = 0;
  2115. frontTex = "rbxassetid://136260219",
  2116. backTex = "rbxassetid://136260219",
  2117. topTex = "rbxassetid://136260219",
  2118. bottomTex = "rbxassetid://136260219",
  2119. leftTex = "rbxassetid://136260219",
  2120. rightTex = "rbxassetid://136260219",
  2121. sound = "rbxassetid://1016978163",
  2122. soundVol = 2,
  2123. hasGravity = false,
  2124. objectType = "Block"
  2125. },
  2126. {
  2127. name = "TNT",
  2128. size = Vector3.new(2.6, 2.6, 2.6),
  2129. transparency = 0;
  2130. frontTex = "rbxassetid://48005067",
  2131. backTex = "rbxassetid://48005067",
  2132. topTex = "rbxassetid://48005073",
  2133. bottomTex = "rbxassetid://48005064",
  2134. leftTex = "rbxassetid://48005067",
  2135. rightTex = "rbxassetid://48005067",
  2136. displayTex = "",
  2137. sound = "rbxassetid://1102186681",
  2138. soundVol = 2,
  2139. hasGravity = false,
  2140. objectType = "Block"
  2141. },
  2142. {
  2143. name = "Coal Block",
  2144. size = Vector3.new(2.6, 2.6, 2.6),
  2145. transparency = 0;
  2146. frontTex = "rbxassetid://152527418",
  2147. backTex = "rbxassetid://152527418",
  2148. topTex = "rbxassetid://152527418",
  2149. bottomTex = "rbxassetid://152527418",
  2150. leftTex = "rbxassetid://152527418",
  2151. rightTex = "rbxassetid://152527418",
  2152. displayTex = "",
  2153. sound = "rbxassetid://1016978163",
  2154. soundVol = 2,
  2155. hasGravity = false,
  2156. objectType = "Block"
  2157. },
  2158. {
  2159. name = "Coal Ore",
  2160. size = Vector3.new(2.6, 2.6, 2.6),
  2161. transparency = 0;
  2162. frontTex = "rbxassetid://152572101",
  2163. backTex = "rbxassetid://152572101",
  2164. topTex = "rbxassetid://152572101",
  2165. bottomTex = "rbxassetid://152572101",
  2166. leftTex = "rbxassetid://152572101",
  2167. rightTex = "rbxassetid://152572101",
  2168. displayTex = "",
  2169. sound = "rbxassetid://1016978163",
  2170. soundVol = 2,
  2171. hasGravity = false,
  2172. objectType = "Block"
  2173. },
  2174. {
  2175. name = "Bedrock",
  2176. size = Vector3.new(2.6, 2.6, 2.6),
  2177. transparency = 0;
  2178. frontTex = "rbxassetid://75881126",
  2179. backTex = "rbxassetid://75881126",
  2180. topTex = "rbxassetid://75881126",
  2181. bottomTex = "rbxassetid://75881126",
  2182. leftTex = "rbxassetid://75881126",
  2183. rightTex = "rbxassetid://75881126",
  2184. displayTex = "",
  2185. sound = "rbxassetid://1016978163",
  2186. soundVol = 2,
  2187. hasGravity = false,
  2188. objectType = "Block"
  2189. },
  2190. {
  2191. name = "Cobblestone",
  2192. size = Vector3.new(2.6, 2.6, 2.6),
  2193. transparency = 0;
  2194. frontTex = "rbxassetid://152572105",
  2195. backTex = "rbxassetid://152572105",
  2196. topTex = "rbxassetid://152572105",
  2197. bottomTex = "rbxassetid://152572105",
  2198. leftTex = "rbxassetid://152572105",
  2199. rightTex = "rbxassetid://152572105",
  2200. displayTex = "",
  2201. sound = "rbxassetid://1016978163",
  2202. soundVol = 2,
  2203. hasGravity = false,
  2204. objectType = "Block"
  2205. },
  2206. {
  2207. name = "Mossy Stone Brick",
  2208. size = Vector3.new(2.6, 2.6, 2.6),
  2209. transparency = 0;
  2210. frontTex = "rbxassetid://61826751",
  2211. backTex = "rbxassetid://61826751",
  2212. topTex = "rbxassetid://61826751",
  2213. bottomTex = "rbxassetid://61826751",
  2214. leftTex = "rbxassetid://61826751",
  2215. rightTex = "rbxassetid://61826751",
  2216. displayTex = "",
  2217. sound = "rbxassetid://1016978163",
  2218. soundVol = 2,
  2219. hasGravity = false,
  2220. objectType = "Block"
  2221. },
  2222. {
  2223. name = "Cracked Stone Brick",
  2224. size = Vector3.new(2.6, 2.6, 2.6),
  2225. transparency = 0;
  2226. frontTex = "rbxassetid://151802087",
  2227. backTex = "rbxassetid://151802087",
  2228. topTex = "rbxassetid://151802087",
  2229. bottomTex = "rbxassetid://151802087",
  2230. leftTex = "rbxassetid://151802087",
  2231. rightTex = "rbxassetid://151802087",
  2232. displayTex = "",
  2233. sound = "rbxassetid://1016978163",
  2234. soundVol = 2,
  2235. hasGravity = false,
  2236. objectType = "Block"
  2237. },
  2238. {
  2239. name = "Chiseled Stone Brick",
  2240. size = Vector3.new(2.6, 2.6, 2.6),
  2241. transparency = 0;
  2242. frontTex = "rbxassetid://151802074",
  2243. backTex = "rbxassetid://151802074",
  2244. topTex = "rbxassetid://151802074",
  2245. bottomTex = "rbxassetid://151802074",
  2246. leftTex = "rbxassetid://151802074",
  2247. rightTex = "rbxassetid://151802074",
  2248. displayTex = "",
  2249. sound = "rbxassetid://1016978163",
  2250. soundVol = 2,
  2251. hasGravity = false,
  2252. objectType = "Block"
  2253. },
  2254. {
  2255. name = "Stone Brick",
  2256. size = Vector3.new(2.6, 2.6, 2.6),
  2257. transparency = 0;
  2258. frontTex = "rbxassetid://61826773",
  2259. backTex = "rbxassetid://61826773",
  2260. topTex = "rbxassetid://61826773",
  2261. bottomTex = "rbxassetid://61826773",
  2262. leftTex = "rbxassetid://61826773",
  2263. rightTex = "rbxassetid://61826773",
  2264. displayTex = "",
  2265. sound = "rbxassetid://1016978163",
  2266. soundVol = 2,
  2267. hasGravity = false,
  2268. objectType = "Block"
  2269. },
  2270. {
  2271. name = "Nether Brick",
  2272. size = Vector3.new(2.6, 2.6, 2.6),
  2273. transparency = 0;
  2274. frontTex = "rbxassetid://151802104",
  2275. backTex = "rbxassetid://151802104",
  2276. topTex = "rbxassetid://151802104",
  2277. bottomTex = "rbxassetid://151802104",
  2278. leftTex = "rbxassetid://151802104",
  2279. rightTex = "rbxassetid://151802104",
  2280. displayTex = "",
  2281. sound = "rbxassetid://1016978163",
  2282. soundVol = 2,
  2283. hasGravity = false,
  2284. objectType = "Block"
  2285. },
  2286. {
  2287. name = "Granite",
  2288. size = Vector3.new(2.6, 2.6, 2.6),
  2289. transparency = 0;
  2290. frontTex = "rbxassetid://151776467",
  2291. backTex = "rbxassetid://151776467",
  2292. topTex = "rbxassetid://151776467",
  2293. bottomTex = "rbxassetid://151776467",
  2294. leftTex = "rbxassetid://151776467",
  2295. rightTex = "rbxassetid://151776467",
  2296. displayTex = "",
  2297. sound = "rbxassetid://1016978163",
  2298. soundVol = 2,
  2299. hasGravity = false,
  2300. objectType = "Block"
  2301. },
  2302. {
  2303. name = "Diorite",
  2304. size = Vector3.new(2.6, 2.6, 2.6),
  2305. transparency = 0;
  2306. frontTex = "rbxassetid://151776452",
  2307. backTex = "rbxassetid://151776452",
  2308. topTex = "rbxassetid://151776452",
  2309. bottomTex = "rbxassetid://151776452",
  2310. leftTex = "rbxassetid://151776452",
  2311. rightTex = "rbxassetid://151776452",
  2312. sound = "rbxassetid://1016978163",
  2313. soundVol = 2,
  2314. hasGravity = false,
  2315. objectType = "Block"
  2316. },
  2317. {
  2318. name = "Andesite",
  2319. size = Vector3.new(2.6, 2.6, 2.6),
  2320. transparency = 0;
  2321. frontTex = "rbxassetid://151776422",
  2322. backTex = "rbxassetid://151776422",
  2323. topTex = "rbxassetid://151776422",
  2324. bottomTex = "rbxassetid://151776422",
  2325. leftTex = "rbxassetid://151776422",
  2326. rightTex = "rbxassetid://151776422",
  2327. displayTex = "",
  2328. sound = "rbxassetid://1016978163",
  2329. soundVol = 2,
  2330. hasGravity = false,
  2331. objectType = "Block"
  2332. },
  2333. {
  2334. name = "Polished Granite",
  2335. size = Vector3.new(2.6, 2.6, 2.6),
  2336. transparency = 0;
  2337. frontTex = "rbxassetid://151776506",
  2338. backTex = "rbxassetid://151776506",
  2339. topTex = "rbxassetid://151776506",
  2340. bottomTex = "rbxassetid://151776506",
  2341. leftTex = "rbxassetid://151776506",
  2342. rightTex = "rbxassetid://151776506",
  2343. displayTex = "",
  2344. sound = "rbxassetid://1016978163",
  2345. soundVol = 2,
  2346. hasGravity = false,
  2347. objectType = "Block"
  2348. },
  2349. {
  2350. name = "Polished Diorite",
  2351. size = Vector3.new(2.6, 2.6, 2.6),
  2352. transparency = 0;
  2353. frontTex = "rbxassetid://151776533",
  2354. backTex = "rbxassetid://151776533",
  2355. topTex = "rbxassetid://151776533",
  2356. bottomTex = "rbxassetid://151776533",
  2357. leftTex = "rbxassetid://151776533",
  2358. rightTex = "rbxassetid://151776533",
  2359. displayTex = "",
  2360. sound = "rbxassetid://1016978163",
  2361. soundVol = 2,
  2362. hasGravity = false,
  2363. objectType = "Block"
  2364. },
  2365. {
  2366. name = "Polished Andesite",
  2367. size = Vector3.new(2.6, 2.6, 2.6),
  2368. transparency = 0;
  2369. frontTex = "rbxassetid://151776506",
  2370. backTex = "rbxassetid://151776506",
  2371. topTex = "rbxassetid://151776506",
  2372. bottomTex = "rbxassetid://151776506",
  2373. leftTex = "rbxassetid://151776506",
  2374. rightTex = "rbxassetid://151776506",
  2375. displayTex = "",
  2376. sound = "rbxassetid://1016978163",
  2377. soundVol = 2,
  2378. hasGravity = false,
  2379. objectType = "Block"
  2380. },
  2381. {
  2382. name = "Brick Block",
  2383. size = Vector3.new(2.6, 2.6, 2.6),
  2384. transparency = 0;
  2385. frontTex = "rbxassetid://59389191",
  2386. backTex = "rbxassetid://59389191",
  2387. topTex = "rbxassetid://59389191",
  2388. bottomTex = "rbxassetid://59389191",
  2389. leftTex = "rbxassetid://59389191",
  2390. rightTex = "rbxassetid://59389191",
  2391. displayTex = "",
  2392. sound = "rbxassetid://1016978163",
  2393. soundVol = 2,
  2394. hasGravity = false,
  2395. objectType = "Block"
  2396. },
  2397. {
  2398. name = "Packed Ice",
  2399. size = Vector3.new(2.6, 2.6, 2.6),
  2400. transparency = 0;
  2401. frontTex = "rbxassetid://152528023",
  2402. backTex = "rbxassetid://152528023",
  2403. topTex = "rbxassetid://152528023",
  2404. bottomTex = "rbxassetid://152528023",
  2405. leftTex = "rbxassetid://152528023",
  2406. rightTex = "rbxassetid://152528023",
  2407. displayTex = "",
  2408. sound = "rbxassetid://1016978163",
  2409. soundVol = 2,
  2410. hasGravity = false,
  2411. objectType = "Block"
  2412. },
  2413. {
  2414. name = "Ice Block",
  2415. size = Vector3.new(2.6, 2.6, 2.6),
  2416. transparency = 1;
  2417. frontTex = "rbxassetid://118555586",
  2418. backTex = "rbxassetid://118555586",
  2419. topTex = "rbxassetid://118555586",
  2420. bottomTex = "rbxassetid://118555586",
  2421. leftTex = "rbxassetid://118555586",
  2422. rightTex = "rbxassetid://118555586",
  2423. displayTex = "",
  2424. sound = "rbxassetid://1016978163",
  2425. soundVol = 2,
  2426. hasGravity = false,
  2427. objectType = "Block"
  2428. },
  2429. {
  2430. name = "Netherrack",
  2431. size = Vector3.new(2.6, 2.6, 2.6),
  2432. transparency = 0;
  2433. frontTex = "rbxassetid://151802119",
  2434. backTex = "rbxassetid://151802119",
  2435. topTex = "rbxassetid://151802119",
  2436. bottomTex = "rbxassetid://151802119",
  2437. leftTex = "rbxassetid://151802119",
  2438. rightTex = "rbxassetid://151802119",
  2439. displayTex = "",
  2440. sound = "rbxassetid://1016978163",
  2441. soundVol = 2,
  2442. hasGravity = false,
  2443. objectType = "Block"
  2444. },
  2445. {
  2446. name = "End Stone",
  2447. size = Vector3.new(2.6, 2.6, 2.6),
  2448. transparency = 0;
  2449. frontTex = "rbxassetid://151802091",
  2450. backTex = "rbxassetid://151802091",
  2451. topTex = "rbxassetid://151802091",
  2452. bottomTex = "rbxassetid://151802091",
  2453. leftTex = "rbxassetid://151802091",
  2454. rightTex = "rbxassetid://151802091",
  2455. displayTex = "",
  2456. sound = "rbxassetid://1016978163",
  2457. soundVol = 2,
  2458. hasGravity = false,
  2459. objectType = "Block"
  2460. },
  2461. {
  2462. name = "Glass Block",
  2463. size = Vector3.new(2.6, 2.6, 2.6),
  2464. transparency = 1;
  2465. frontTex = "rbxassetid://152239003",
  2466. backTex = "rbxassetid://152239003",
  2467. topTex = "rbxassetid://152239003",
  2468. bottomTex = "rbxassetid://152239003",
  2469. leftTex = "rbxassetid://152239003",
  2470. rightTex = "rbxassetid://152239003",
  2471. displayTex = "",
  2472. sound = "rbxassetid://1016978163",
  2473. soundVol = 2,
  2474. hasGravity = false,
  2475. objectType = "Block"
  2476. },
  2477. {
  2478. name = "Glowstone",
  2479. size = Vector3.new(2.6, 2.6, 2.6),
  2480. transparency = 0;
  2481. frontTex = "rbxassetid://54790811",
  2482. backTex = "rbxassetid://54790811",
  2483. topTex = "rbxassetid://54790811",
  2484. bottomTex = "rbxassetid://54790811",
  2485. leftTex = "rbxassetid://54790811",
  2486. rightTex = "rbxassetid://54790811",
  2487. displayTex = "",
  2488. sound = "rbxassetid://1016978163",
  2489. soundVol = 2,
  2490. hasGravity = false,
  2491. objectType = "Block"
  2492. },
  2493. {
  2494. name = "Bookshelf",
  2495. size = Vector3.new(2.6, 2.6, 2.6),
  2496. transparency = 0;
  2497. frontTex = "rbxassetid://118554092",
  2498. backTex = "rbxassetid://118554092",
  2499. topTex = "rbxassetid://346201871",
  2500. bottomTex = "rbxassetid://346201871",
  2501. leftTex = "rbxassetid://118554092",
  2502. rightTex = "rbxassetid://118554092",
  2503. displayTex = "",
  2504. sound = "rbxassetid://507863457",
  2505. soundVol = 2,
  2506. hasGravity = false,
  2507. objectType = "Block"
  2508. },
  2509. {
  2510. name = "Oak Wood Planks",
  2511. size = Vector3.new(2.6, 2.6, 2.6),
  2512. transparency = 0;
  2513. frontTex = "rbxassetid://346201871",
  2514. backTex = "rbxassetid://346201871",
  2515. topTex = "rbxassetid://346201871",
  2516. bottomTex = "rbxassetid://346201871",
  2517. leftTex = "rbxassetid://346201871",
  2518. rightTex = "rbxassetid://346201871",
  2519. displayTex = "",
  2520. sound = "rbxassetid://507863457",
  2521. soundVol = 2,
  2522. hasGravity = false,
  2523. objectType = "Block"
  2524. },
  2525. {
  2526. name = "Oak Log",
  2527. size = Vector3.new(2.6, 2.6, 2.6),
  2528. transparency = 0;
  2529. frontTex = "rbxassetid://71445924",
  2530. backTex = "rbxassetid://71445924",
  2531. topTex = "rbxassetid://152538557",
  2532. bottomTex = "rbxassetid://152538557",
  2533. leftTex = "rbxassetid://71445924",
  2534. rightTex = "rbxassetid://71445924",
  2535. displayTex = "",
  2536. sound = "rbxassetid://507863457",
  2537. soundVol = 2,
  2538. hasGravity = false,
  2539. objectType = "Block"
  2540. },
  2541. {
  2542. name = "Oak Leaves",
  2543. size = Vector3.new(2.6, 2.6, 2.6),
  2544. transparency = 1;
  2545. frontTex = "rbxassetid://151708391",
  2546. backTex = "rbxassetid://151708391",
  2547. topTex = "rbxassetid://151708391",
  2548. bottomTex = "rbxassetid://151708391",
  2549. leftTex = "rbxassetid://151708391",
  2550. rightTex = "rbxassetid://151708391",
  2551. displayTex = "",
  2552. sound = "rbxassetid://507863457",
  2553. -- couldn't find a leaves sound for this one, sorry lol
  2554. soundVol = 2,
  2555. hasGravity = false,
  2556. objectType = "Block"
  2557. }
  2558. }
  2559. local toolBar = {
  2560. {
  2561. name = "Dirt Block",
  2562. size = Vector3.new(2.6, 2.6, 2.6),
  2563. transparency = 0;
  2564. frontTex = "rbxassetid://152569532",
  2565. backTex = "rbxassetid://152569532",
  2566. topTex = "rbxassetid://152569532",
  2567. bottomTex = "rbxassetid://152569532",
  2568. leftTex = "rbxassetid://152569532",
  2569. rightTex = "rbxassetid://152569532",
  2570. displayTex = "",
  2571. sound = "rbxassetid://1102186681",
  2572. soundVol = 1.25,
  2573. hasGravity = false,
  2574. objectType = "Block"
  2575. },
  2576. {
  2577. name = "Grass Block",
  2578. size = Vector3.new(2.6, 2.6, 2.6),
  2579. transparency = 0;
  2580. frontTex = "rbxassetid://96430337",
  2581. backTex = "rbxassetid://96430337",
  2582. topTex = "rbxassetid://96430265",
  2583. bottomTex = "rbxassetid://179655033",
  2584. leftTex = "rbxassetid://96430337",
  2585. rightTex = "rbxassetid://96430337",
  2586. displayTex = "",
  2587. sound = "rbxassetid://1102186681",
  2588. soundVol = 1.25,
  2589. hasGravity = false,
  2590. objectType = "Block"
  2591. },
  2592. {
  2593. name = "Stone",
  2594. size = Vector3.new(2.6, 2.6, 2.6),
  2595. transparency = 0;
  2596. frontTex = "rbxassetid://75880927",
  2597. backTex = "rbxassetid://75880927",
  2598. topTex = "rbxassetid://75880927",
  2599. bottomTex = "rbxassetid://75880927",
  2600. leftTex = "rbxassetid://75880927",
  2601. rightTex = "rbxassetid://75880927",
  2602. displayTex = "",
  2603. sound = "rbxassetid://1016978163",
  2604. soundVol = 2,
  2605. hasGravity = false,
  2606. objectType = "Block"
  2607. },
  2608. {
  2609. name = "Diamond Ore",
  2610. size = Vector3.new(2.6, 2.6, 2.6),
  2611. transparency = 0;
  2612. frontTex = "rbxassetid://152572119",
  2613. backTex = "rbxassetid://152572119",
  2614. topTex = "rbxassetid://152572119",
  2615. bottomTex = "rbxassetid://152572119",
  2616. leftTex = "rbxassetid://152572119",
  2617. rightTex = "rbxassetid://152572119",
  2618. displayTex = "",
  2619. sound = "rbxassetid://1016978163",
  2620. soundVol = 2,
  2621. hasGravity = false,
  2622. objectType = "Block"
  2623. },
  2624. {
  2625. name = "Diamond Block",
  2626. size = Vector3.new(2.6, 2.6, 2.6),
  2627. transparency = 0;
  2628. frontTex = "rbxassetid://56749955",
  2629. backTex = "rbxassetid://56749955",
  2630. topTex = "rbxassetid://56749955",
  2631. bottomTex = "rbxassetid://56749955",
  2632. leftTex = "rbxassetid://56749955",
  2633. rightTex = "rbxassetid://56749955",
  2634. displayTex = "",
  2635. sound = "rbxassetid://1016978163",
  2636. soundVol = 2,
  2637. hasGravity = false,
  2638. objectType = "Block"
  2639. },
  2640. {
  2641. name = "Oak Wood Planks",
  2642. size = Vector3.new(2.6, 2.6, 2.6),
  2643. transparency = 0;
  2644. frontTex = "rbxassetid://346201871",
  2645. backTex = "rbxassetid://346201871",
  2646. topTex = "rbxassetid://346201871",
  2647. bottomTex = "rbxassetid://346201871",
  2648. leftTex = "rbxassetid://346201871",
  2649. rightTex = "rbxassetid://346201871",
  2650. displayTex = "",
  2651. sound = "rbxassetid://507863457",
  2652. soundVol = 2,
  2653. hasGravity = false,
  2654. objectType = "Block"
  2655. },
  2656. {
  2657. name = "Oak Log",
  2658. size = Vector3.new(2.6, 2.6, 2.6),
  2659. transparency = 0;
  2660. frontTex = "rbxassetid://71445924",
  2661. backTex = "rbxassetid://71445924",
  2662. topTex = "rbxassetid://152538557",
  2663. bottomTex = "rbxassetid://152538557",
  2664. leftTex = "rbxassetid://71445924",
  2665. rightTex = "rbxassetid://71445924",
  2666. displayTex = "",
  2667. sound = "rbxassetid://507863457",
  2668. soundVol = 2,
  2669. hasGravity = false,
  2670. objectType = "Block"
  2671. }
  2672. }
  2673. local draggingBlock = nil
  2674. function divide(x, d)
  2675. if x ~= 0 and d ~= 0 then
  2676. return x/d
  2677. else
  2678. return x
  2679. end
  2680. end -- so it doesn't divide by zero
  2681. function getDistance(v1, v2)
  2682. return math.abs((Vector3.new(math.abs(v2.X - v1.X), math.abs(v2.Y - v1.Y), math.abs(v2.Z - v1.Z))).Magnitude)
  2683. end
  2684. function SnapToGrid(x, gridX)
  2685. local x = math.floor((x / gridX) + 0.5) * gridX
  2686. return x
  2687. end
  2688. function round(x)
  2689. if x%2 ~= 0.5 then
  2690. return math.floor(x+0.5)
  2691. end
  2692. return x-0.5
  2693. end
  2694. function weldTo(part1, part2)
  2695. local weld = Instance.new("Weld", part1)
  2696. weld.Part0 = part1
  2697. weld.Part1 = part2
  2698. return weld
  2699. end
  2700. function getMagnitudeXZ(velocity)
  2701. return math.sqrt(math.abs(velocity.X)^2 + math.abs(velocity.Z)^2)
  2702. end
  2703. function findHumanoid(inst)
  2704. local find = inst
  2705. local hum = nil
  2706. repeat
  2707. if find.Name == "Workspace" then return nil end
  2708. find = find.Parent
  2709. hum = find:FindFirstChild("Humanoid")
  2710. until hum
  2711. --if hum then print("found!!") else print("aw... not found") end
  2712. --if hum.ClassName ~= "Humanoid" then hum = nil end
  2713. return hum
  2714. end
  2715. function getSideByLocation(loc)
  2716. local side = nil
  2717. if loc.X < 0 then side = "Left" end
  2718. if loc.X > 0 then side = "Right" end
  2719. if loc.Y > 0 then side = "Top" end
  2720. if loc.Y < 0 then side = "Bottom" end
  2721. if loc.Z < 0 then side = "Front" end
  2722. if loc.Z > 0 then side = "Back" end
  2723.  
  2724. if (math.abs(loc.X) > 0 and math.abs(loc.Y) > 0) or
  2725. (math.abs(loc.X) > 0 and math.abs(loc.Z) > 0) or
  2726. (math.abs(loc.Y) > 0 and math.abs(loc.Z) > 0)
  2727. then
  2728. return nil
  2729. end
  2730. return side
  2731. end
  2732. function getSideByLocationRedstone(loc)
  2733. local side = nil
  2734. if loc.X < 0 then side = "Left" end
  2735. if loc.X > 0 then side = "Right" end
  2736. if loc.Y > 0 then side = "Top" end
  2737. if loc.Y < 0 then side = "Bottom" end
  2738. if loc.Z < 0 then side = "Front" end
  2739. if loc.Z > 0 then side = "Back" end
  2740.  
  2741. if (math.abs(loc.X) > 0 and math.abs(loc.Y) > 0) or
  2742. (math.abs(loc.X) > 0 and math.abs(loc.Z) > 0) or
  2743. (math.abs(loc.Y) > 0 and math.abs(loc.Z) > 0)
  2744. then
  2745. return nil
  2746. end
  2747. return side
  2748. end
  2749. function getBlockAtRegion(region)
  2750. local blockFound = nil
  2751. for _,part in pairs(game.Workspace:FindPartsInRegion3(region, nil, math.huge)) do
  2752. local usePart = true
  2753. if part.Name == "Debris" then usePart = false end
  2754. if usePart == true then
  2755. blockFound = part
  2756. break
  2757. end
  2758. end
  2759. return blockFound
  2760. end
  2761. function getRedstoneAtRegion(region)
  2762. local blockFound = nil
  2763. for _,part in pairs(game.Workspace:FindPartsInRegion3(region, nil, math.huge)) do
  2764. if isRedstone(part) then
  2765. blockFound = part
  2766. break
  2767. end
  2768. end
  2769. return blockFound
  2770. end
  2771. function isRedstone(block)
  2772. local objType = block:FindFirstChild("ObjectType")
  2773. if objType then
  2774. if objType.Value == "Redstone Dust" then
  2775. return true
  2776. else
  2777. return false
  2778. end
  2779. end
  2780. end
  2781. function updateRedstoneDust(dust, leftBlk, rightBlk, topBlk, bottomBlk, frontBlk, backBlk, recursion)
  2782. local objType = nil
  2783. if dust then
  2784. objType = dust:FindFirstChild("ObjectType")
  2785. end
  2786.  
  2787. local redstoneDust = "rbxassetid://151911305"
  2788. local redstoneLine = "rbxassetid://151907047"
  2789. local redstoneCorner = "rbxassetid://151907106"
  2790. local redstoneT = "rbxassetid://151907156"
  2791. local redstoneCross = "rbxassetid://151906997"
  2792.  
  2793. local Rotation = 0
  2794.  
  2795. local theresRedstoneAtLeft = false
  2796. local theresRedstoneAtRight = false
  2797. local theresRedstoneAtFront = false
  2798. local theresRedstoneAtBack = false
  2799.  
  2800. if leftBlk then theresRedstoneAtLeft = isRedstone(leftBlk) end
  2801. if rightBlk then theresRedstoneAtRight = isRedstone(rightBlk) end
  2802. if frontBlk then theresRedstoneAtFront = isRedstone(frontBlk) end
  2803. if backBlk then theresRedstoneAtBack = isRedstone(backBlk) end
  2804.  
  2805. if objType then
  2806. if objType.Value == "Redstone Dust" then
  2807. local topDecal = dust:FindFirstChild("Top")
  2808. if topDecal then
  2809. if theresRedstoneAtBack == false and theresRedstoneAtFront == false and
  2810. theresRedstoneAtLeft == false and theresRedstoneAtRight == false then
  2811. topDecal.Texture = redstoneDust
  2812. Rotation = 0
  2813. end
  2814.  
  2815. if theresRedstoneAtLeft == true or theresRedstoneAtRight == true then
  2816. topDecal.Texture = redstoneLine
  2817. Rotation = 0
  2818. end
  2819.  
  2820. if theresRedstoneAtFront == true or theresRedstoneAtBack == true then
  2821. topDecal.Texture = redstoneLine
  2822. Rotation = 90
  2823. end
  2824.  
  2825. if theresRedstoneAtLeft == true and theresRedstoneAtBack == true then
  2826. topDecal.Texture = redstoneCorner
  2827. Rotation = 0
  2828. end
  2829.  
  2830. if theresRedstoneAtBack == true and theresRedstoneAtRight == true then
  2831. topDecal.Texture = redstoneCorner
  2832. Rotation = 90
  2833. end
  2834.  
  2835. if theresRedstoneAtRight == true and theresRedstoneAtFront == true then
  2836. topDecal.Texture = redstoneCorner
  2837. Rotation = 180
  2838. end
  2839.  
  2840. if theresRedstoneAtFront == true and theresRedstoneAtLeft == true then
  2841. topDecal.Texture = redstoneCorner
  2842. Rotation = -90
  2843. end
  2844.  
  2845. if theresRedstoneAtBack == true and theresRedstoneAtLeft == true
  2846. and theresRedstoneAtFront == true then
  2847. topDecal.Texture = redstoneT
  2848. Rotation = -90
  2849. end
  2850.  
  2851. if theresRedstoneAtLeft == true and theresRedstoneAtFront == true
  2852. and theresRedstoneAtRight == true then
  2853. topDecal.Texture = redstoneT
  2854. Rotation = -180
  2855. end
  2856.  
  2857. if theresRedstoneAtFront == true and theresRedstoneAtRight == true
  2858. and theresRedstoneAtBack == true then
  2859. topDecal.Texture = redstoneT
  2860. Rotation = 90
  2861. end
  2862.  
  2863. if theresRedstoneAtRight == true and theresRedstoneAtBack == true
  2864. and theresRedstoneAtLeft == true then
  2865. topDecal.Texture = redstoneT
  2866. Rotation = 0
  2867. end
  2868.  
  2869. if theresRedstoneAtLeft == true and theresRedstoneAtRight == true and
  2870. theresRedstoneAtFront == true and theresRedstoneAtBack == true then
  2871. topDecal.Texture = redstoneCross
  2872. Rotation = 0
  2873. end
  2874. end
  2875. else
  2876. error("Not redstone dust.")
  2877. end
  2878. end
  2879.  
  2880. if recursion == true then
  2881. local function updateTex(blockTarget)
  2882. local leftSide = nil
  2883. local rightSide = nil
  2884. local frontSide = nil
  2885. local backSide = nil
  2886.  
  2887. local Point1 = blockTarget.CFrame.p - Vector3.new(2.6, 0.1, 2.6)
  2888. local Point2 = blockTarget.CFrame.p + Vector3.new(2.6, 0.1, 2.6)
  2889. local Region = Region3.new(Point1, Point2)
  2890. for _,part in pairs(game.Workspace:FindPartsInRegion3(
  2891. Region,
  2892. nil,
  2893. math.huge
  2894. )) do
  2895. local objType = part:FindFirstChild("ObjectType")
  2896. if isRedstone(part) then
  2897. local side = getSideByLocationRedstone(blockTarget.CFrame.p - part.CFrame.p)
  2898. if side == "Left" then
  2899. leftSide = part
  2900. elseif side == "Right" then
  2901. rightSide = part
  2902. elseif side == "Front" then
  2903. frontSide = part
  2904. elseif side == "Back" then
  2905. backSide = part
  2906. elseif side == "Left Top" then
  2907. leftSide = part
  2908. elseif side == "Right Top" then
  2909. rightSide = part
  2910. elseif side == "Front Top" then
  2911. frontSide = part
  2912. elseif side == "Back Top" then
  2913. backSide = part
  2914. elseif side == "Left Bottom" then
  2915. leftSide = part
  2916. elseif side == "Right Bottom" then
  2917. rightSide = part
  2918. elseif side == "Front Bottom" then
  2919. frontSide = part
  2920. elseif side == "Back Bottom" then
  2921. backSide = part
  2922. end
  2923. end
  2924. end
  2925.  
  2926. updateRedstoneDust(blockTarget, leftSide, rightSide, nil, nil, frontSide, backSide, false)
  2927. end
  2928. if leftBlk and theresRedstoneAtLeft then updateTex(leftBlk) end
  2929. if rightBlk and theresRedstoneAtRight then updateTex(rightBlk) end
  2930. if frontBlk and theresRedstoneAtFront then updateTex(frontBlk) end
  2931. if backBlk and theresRedstoneAtBack then updateTex(backBlk) end
  2932. end
  2933.  
  2934. if dust then dust.CFrame = CFrame.new(dust.CFrame.p.X, dust.CFrame.p.Y, dust.CFrame.p.Z) * CFrame.Angles(0, math.rad(Rotation), 0) end
  2935. end
  2936. if player then
  2937. local char = player.Character
  2938. if char then
  2939. for _,cM in pairs(char:GetChildren()) do
  2940. if cM.ClassName == "CharacterMesh" then and cM.Name ~= "cl" cM:Destroy() end
  2941. end
  2942. --[]
  2943.  
  2944. local humRootPart = char:WaitForChild("HumanoidRootPart")
  2945. local head = char:WaitForChild("Head")
  2946. local torso = char:WaitForChild("Torso")
  2947. local lArm = char:WaitForChild("Left Arm")
  2948. local rArm = char:WaitForChild("Right Arm")
  2949. local lLeg = char:WaitForChild("Left Leg")
  2950. local rLeg = char:WaitForChild("Right Leg")
  2951.  
  2952. local humanoid = char:WaitForChild("Humanoid")
  2953.  
  2954. local camera = workspace.CurrentCamera
  2955.  
  2956. local camPart = Instance.new("Part", camera)
  2957. camPart.Name = "CamPart Local"
  2958. camPart.Size = Vector3.new(0, 0, 0)
  2959. camPart.CFrame = camera.CFrame
  2960. camPart.CanCollide = false
  2961. camPart.Anchored = true
  2962. camPart.Transparency = 1
  2963. local Model = Instance.new("Model", camera)
  2964. Shirt0 = Instance.new("Shirt",Model)
  2965. Shirt0.ShirtTemplate = "rbxassetid://4666109142"
  2966. cl = Instance.new("CharacterMesh",Model)
  2967. cl.MeshId = 1112244824
  2968. cl.BodyPart = "RightArm"
  2969. de = Instance.new("Humanoid")
  2970. de.Parent = Model
  2971. local cameraHand = Instance.new("Part", Model)
  2972. cameraHand.Size = Vector3.new(0.65, 1.95, 0.65)
  2973. cameraHand.CanCollide = false
  2974. cameraHand.Anchored = true
  2975. cameraHand.Name = "Right Arm"
  2976.  
  2977. local cameraHandItem = Instance.new("Part", camera)
  2978. cameraHandItem.Name = "CameraHandItem"
  2979. cameraHandItem.Size = Vector3.new(1.1, 1.1, 1.1)
  2980. cameraHandItem.Anchored = true
  2981. cameraHandItem.CanCollide = false
  2982. cameraHandItem.Transparency = 1
  2983.  
  2984. -- welding doesn't really work.
  2985. --local cameraHandWeld = Instance.new("Motor6D", camPart)
  2986. --cameraHandWeld.Part0 = camPart
  2987. --cameraHandWeld.Part1 = cameraHand
  2988. --cameraHandWeld.C0 = CFrame.new(5, 0, 0)
  2989.  
  2990. wait(0.25)
  2991.  
  2992. -- local billNameTag = Instance.new("BillboardGui", char)
  2993. -- billNameTag.Size = UDim2.new(1, 0, 1, 0)
  2994. -- billNameTag.Adornee = head
  2995. -- billNameTag.PlayerToHideFrom = player
  2996. --
  2997. -- local textLabel = Instance.new("TextLabel", billNameTag)
  2998. -- textLabel.Font = "Arcade"
  2999. -- --textLabel.Size = UDim2.new(1, 0, 1, 0)
  3000. -- textLabel.TextScaled = true
  3001. -- --textLabel.TextSize = 100
  3002. -- textLabel.Text = targetName
  3003. -- textLabel.Size = UDim2.new(textLabel.TextBounds.X/100, 0, 0.75, 0)
  3004. -- textLabel.BorderSizePixel = 0
  3005. -- textLabel.BackgroundColor3 = Color3.new(0, 0, 0)
  3006. -- textLabel.TextColor3 = Color3.new(1, 1, 1)
  3007. -- textLabel.BackgroundTransparency = 0.5
  3008. --
  3009. -- if textLabel.Text == "Depr1" then
  3010. -- textLabel.TextColor3 = Color3.new(1, 0.75, 0)
  3011. -- end
  3012. --
  3013. -- billNameTag.SizeOffset = Vector2.new(-textLabel.TextBounds.X/200 + 0.5, 0)
  3014. -- billNameTag.StudsOffset = Vector3.new(0, 1.5, 0)
  3015.  
  3016.  
  3017. humanoid.Parent = char
  3018.  
  3019. local ticks = 0
  3020. local times = 0
  3021.  
  3022. local walkAnim = 0
  3023. local increaseWalkAnim = 1
  3024.  
  3025. local idleAnimRotX = 0
  3026. local idleAnimRotZ = 0
  3027. local sneaking = 0
  3028.  
  3029. --local RS = game:GetService("RunService").RenderStepped
  3030. local Mouse = player:GetMouse()
  3031.  
  3032. local oldHP = humanoid.Health
  3033. local damageTime = 0
  3034.  
  3035. local punchRotX = 0
  3036. local punchRotY = 0
  3037. local punchRotZ = 0
  3038. local punchRotXcam = 0
  3039. local punchRotYcam = 0
  3040. local punchRotZcam = 0
  3041. local punchSpeed = 0
  3042. local punching = 0
  3043. local selectedBlock = 8
  3044. local punchEnded = 1
  3045. local itemOnHand = nil
  3046.  
  3047. local selectBox = Instance.new("SelectionBox", camera)
  3048. selectBox.Transparency = 0.5
  3049. selectBox.Color3 = Color3.new(0, 0, 0)
  3050. selectBox.LineThickness = 0
  3051.  
  3052.  
  3053. local sound = Instance.new("Sound", char)
  3054. sound.Name = "Hurt"
  3055. sound.Volume = 10
  3056. sound.SoundId = "rbxassetid://535690488"
  3057.  
  3058. local facesToResize = {"Front", "Back", "Left", "Right", "Bottom", "Top"}
  3059. punchneeded = false
  3060. local camCurrentZoom = (camera.CFrame.p - head.Position).magnitude
  3061. Mouse.Button1Down:connect(function()
  3062. punchneeded = true
  3063. end)
  3064. Mouse.Button1Up:connect(function()
  3065. punchneeded = false
  3066. end)
  3067. Mouse.KeyDown:connect(function(key)
  3068. if key == "b" then
  3069. if punchEnded == 1 then punching = 1 end
  3070. end
  3071. end)
  3072.  
  3073. local changedItem = false
  3074. local hasItemOnHand = 0
  3075. local hi = 0
  3076. -- selection thingy
  3077.  
  3078. --
  3079. local oldItemOnHand = itemOnHand
  3080. function updateItemOnHand()
  3081. for _,d in pairs(cameraHandItem:GetChildren()) do
  3082. d:Destroy()
  3083. end
  3084. if itemOnHand ~= nil then
  3085.  
  3086. putTexture(cameraHandItem, itemOnHand.frontTex, itemOnHand.backTex,
  3087. itemOnHand.topTex, itemOnHand.bottomTex,
  3088. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  3089.  
  3090. for _,f in pairs(facesToResize) do
  3091. cameraHandItem:WaitForChild(f).StudsPerTileU = 1.1
  3092. cameraHandItem:WaitForChild(f).StudsPerTileV = 1.1
  3093. end
  3094.  
  3095. cameraHand.Transparency = 1
  3096. for _,f in pairs(facesToResize) do
  3097. cameraHand:WaitForChild(f).Transparency = 1
  3098. cameraHand:WaitForChild(f).Transparency = 1
  3099. end
  3100. else
  3101. cameraHand.Transparency = 0
  3102. for _,f in pairs(facesToResize) do
  3103. cameraHand:WaitForChild(f).Transparency = 0
  3104. cameraHand:WaitForChild(f).Transparency = 0
  3105. end
  3106. end
  3107. if oldItemOnHand ~= itemOnHand then
  3108. changedItem = true
  3109. end
  3110. end
  3111.  
  3112. local pressedWTimes = 0
  3113. local sprintingNum = 0
  3114. local sprinting = false
  3115. Mouse.KeyDown:connect(function(key)
  3116. if sprinting == false then sprintingNum = 0 else sprintingNum = 1 end
  3117. if (key == "w" and sprinting == false and sneaking == 0) then
  3118. if pressedWTimes >= 1 or key == Enum.KeyCode.LeftControl then
  3119. sprinting = true
  3120. --humanoid.WalkSpeed = humanoid.WalkSpeed * 1.5
  3121. pressedWTimes = 0
  3122. coroutine.resume(coroutine.create(function()
  3123. for i = 1, 24 do
  3124. camera.FieldOfView = camera.FieldOfView + ((24-i)/10)
  3125. RS:wait()
  3126. end
  3127. end))
  3128. end
  3129. pressedWTimes = pressedWTimes + 1
  3130. coroutine.resume(coroutine.create(function()
  3131. for i = 1, 9 do
  3132. if sprinting == true then break end
  3133. wait()
  3134. end
  3135. pressedWTimes = 0
  3136. end))
  3137. end
  3138. if key == "e" then
  3139. if selectedBlock == 8 then
  3140. selectedBlock = 0
  3141. end
  3142.  
  3143. selectedBlock = selectedBlock + 1
  3144. oldItemOnHand = itemOnHand
  3145. itemOnHand = toolBar[selectedBlock + 1]
  3146. coroutine.resume(coroutine.create(function()
  3147. for _,d in pairs(cameraHandItem:GetChildren()) do
  3148. d:Destroy()
  3149. end
  3150. if itemOnHand ~= nil then
  3151.  
  3152. putTexture(cameraHandItem, itemOnHand.frontTex, itemOnHand.backTex,
  3153. itemOnHand.topTex, itemOnHand.bottomTex,
  3154. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  3155.  
  3156. for _,f in pairs(facesToResize) do
  3157. cameraHandItem:WaitForChild(f).StudsPerTileU = 1.1
  3158. cameraHandItem:WaitForChild(f).StudsPerTileV = 1.1
  3159. end
  3160.  
  3161. cameraHand.Transparency = 1
  3162. for _,f in pairs(facesToResize) do
  3163. cameraHand:WaitForChild(f).Transparency = 1
  3164. cameraHand:WaitForChild(f).Transparency = 1
  3165. end
  3166. else
  3167. cameraHand.Transparency = 0
  3168. for _,f in pairs(facesToResize) do
  3169. cameraHand:WaitForChild(f).Transparency = 0
  3170. cameraHand:WaitForChild(f).Transparency = 0
  3171. end
  3172. end
  3173. if oldItemOnHand ~= itemOnHand then
  3174. changedItem = true
  3175. end
  3176. end))
  3177. if hasItemOnHand == 0 and itemOnHand then hi = 1 end
  3178. if hasItemOnHand == 1 and itemOnHand == nil then hi = 1 end
  3179. selectLabel.Position = UDim2.new(0.5, -160 + ((selectedBlock)*40), 1, -105)
  3180. end
  3181. end)
  3182. Mouse.KeyUp:connect(function(key)
  3183. if sprinting == false then sprintingNum = 0 else sprintingNum = 1 end
  3184. if (key == "w" and sprinting == true and sneaking == 0) then
  3185. sprinting = false
  3186. --humanoid.WalkSpeed = humanoid.WalkSpeed / 1.5
  3187. coroutine.resume(coroutine.create(function()
  3188. for i = 1, 24 do
  3189. camera.FieldOfView = camera.FieldOfView - ((24-i)/10)
  3190. RS:wait()
  3191. end
  3192. end))
  3193. end
  3194. end)
  3195. firstperson = false
  3196. Mouse.KeyUp:connect(function(key)
  3197. if key == "k" then
  3198. if firstperson == true then
  3199. firstperson = false
  3200. else
  3201. firstperson = true
  3202. end
  3203. end
  3204. end)
  3205. local interrump = false
  3206. game:GetService('RunService'):BindToRenderStep('Camera', Enum.RenderPriority.Camera.Value, function()
  3207. if humanoid.Health < oldHP then
  3208. interrump = true
  3209. RS:wait()
  3210. interrump = false
  3211. for i = 1, 15 do
  3212. if interrump == true then interrump = false break end
  3213. camera.CFrame = camera.CFrame * CFrame.Angles(0, 0, -math.rad(15-i))
  3214. RS:wait()
  3215. end
  3216. end
  3217. end)
  3218.  
  3219. Mouse.TargetFilter = camera
  3220.  
  3221. local dead = false
  3222. local humOffset = CFrame.new(0, 0, 0)
  3223. local camHandY = 0
  3224. local camHandZ = 0
  3225. local cameraHandCFrame = CFrame.new(1.15, -1.35, -2) * CFrame.fromEulerAnglesXYZ(math.rad(90), math.rad(55), math.rad(20))
  3226. --cameraHandWeld = Instance.new("Weld",head)
  3227. --cameraHandWeld.Part0 = head
  3228. --cameraHandWeld.Part1 = cameraHand
  3229. --cameraHandWeld.C0 = CFrame.new(1.15, -1.35, -2) * CFrame.fromEulerAnglesXYZ(math.rad(90), math.rad(55), math.rad(20))
  3230. local bodyRot = CFrame.new(0, 0, 0)
  3231. --local lastCamRot = camPart.Orientation
  3232. while RS:wait() do
  3233. if firstperson == true then
  3234. player.CameraMode = Enum.CameraMode.LockFirstPerson
  3235. else
  3236. player.CameraMode = Enum.CameraMode.Classic
  3237. end
  3238. if punchneeded == true then
  3239. if punchEnded == 1 then punching = 1 end
  3240. end
  3241. --cameraHandCFrame = CFrame.new(1.15, -1.35, -2) * CFrame.fromEulerAnglesXYZ(math.rad(90), math.rad(55), math.rad(20))
  3242. cameraHand.CFrame = camPart.CFrame * cameraHandCFrame
  3243. cameraHandItem.CFrame = cameraHand.CFrame * CFrame.new(0, -0.5, 0) * CFrame.Angles(math.rad(-210), math.rad(-40), math.rad(-100)) * CFrame.new(0, -0.35, 0)
  3244.  
  3245. camCurrentZoom = ((CFrame.new(0, -1*sneaking, 0) * camera.CFrame).p - head.Position).magnitude
  3246. if itemOnHand ~= nil then
  3247. hasItemOnHand = 1
  3248. else
  3249. hasItemOnHand = 0
  3250. end
  3251. if humanoid.Health < oldHP then
  3252. damageTime = 60
  3253. --sound:Play()
  3254. end
  3255. oldHP = humanoid.Health
  3256. if damageTime > 0 and humanoid.Health > 0 then
  3257. for _,p in pairs(char:GetChildren()) do
  3258. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  3259. if p.Name == "DamagePart" then
  3260. p.Transparency = 0.5
  3261. end
  3262. end
  3263. end
  3264. damageTime = damageTime - 2
  3265. if damageTime <= 0 then
  3266. for _,p in pairs(char:GetChildren()) do
  3267. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  3268. if p.Name == "DamagePart" then
  3269. p.Transparency = 1
  3270. end
  3271. end
  3272. end
  3273. end
  3274. end
  3275. camPart.CFrame = camera.CFrame
  3276.  
  3277. if getMagnitudeXZ(torso.Velocity) > 1 then
  3278. if walkAnim >= 1 then
  3279. increaseWalkAnim = -1
  3280. elseif walkAnim <= -1 then
  3281. increaseWalkAnim = 1
  3282. end
  3283. walkAnim = walkAnim + (increaseWalkAnim/(10+(sneaking*20))) * ((5 + getMagnitudeXZ(torso.Velocity))/20)
  3284. else
  3285. walkAnim = 0
  3286. end
  3287.  
  3288. --lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*45), 0, 0)
  3289. --rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  3290. --
  3291. --rootJoint.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  3292. --print(math.abs(head.Orientation.Y) - math.abs(humRootPart.Orientation.Y))
  3293. --if (head.Orientation.Y * 2) - (head.Orientation.Y + torso.Orientation.Y) > 45 then
  3294. --humRootPart.CFrame = humRootPart.CFrame * CFrame.Angles(0, math.rad(-45 + head.Orientation.Y), 0)
  3295. --print("-45")
  3296. --end
  3297. --if (head.Orientation.Y * 2) - (head.Orientation.Y + torso.Orientation.Y) < -45 then
  3298. --humRootPart.CFrame = humRootPart.CFrame * CFrame.Angles(0, math.rad(45 + head.Orientation.Y), 0)
  3299. --print("45")
  3300. --end
  3301.  
  3302. if changedItem then
  3303. changedItem = false
  3304. coroutine.resume(coroutine.create(function()
  3305. for i = 1, 8 do
  3306. camHandY = camHandY - 0.2
  3307. RS:wait()
  3308. end
  3309. for i = 1, 8 do
  3310. camHandY = camHandY + 0.2
  3311. RS:wait()
  3312. end
  3313. end))
  3314. end
  3315.  
  3316. --move these arms
  3317.  
  3318. if Mouse.Target and getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  3319. if Mouse.Target.Parent:FindFirstChild("Humanoid") == nil and Mouse.Target.Parent ~= camera then
  3320. selectBox.Adornee = Mouse.Target
  3321. else
  3322. selectBox.Adornee = nil
  3323. end
  3324. else
  3325. selectBox.Adornee = nil
  3326. end
  3327.  
  3328. --local neckYRot = math.rad(camPart.Orientation.Y - torso.Orientation.Y)
  3329.  
  3330. --neck.C1 = CFrame.new(0, 0.975, 0) * CFrame.fromEulerAnglesXYZ(math.rad(sneaking*45), neckYRot, 0)
  3331. --neck.C0 = CFrame.new(0, -0.65, 0) * CFrame.Angles(-math.rad(camPart.Orientation.X - torso.Orientation.X - (sneaking*45)), 0, 0)
  3332.  
  3333. --print(AngleDifference(camPart.Orientation, torso.Orientation).Y)
  3334.  
  3335. local negate = 1
  3336. if torso.Velocity.Y < 0 then
  3337. negate = -1
  3338. end
  3339.  
  3340. --local vel = math.log(math.abs(torso.Velocity.Y))*negate
  3341. --if vel == math.huge or vel == -math.huge then vel = 0.1 end
  3342. --local vel = torso.Velocity.Y^0.6
  3343.  
  3344. local BobbingY = walkAnim*2
  3345. if BobbingY >= 1 then BobbingY = 1 BobbingY = -BobbingY end
  3346.  
  3347. --local rotationSpeed = AngleDifference(camPart.Orientation, lastCamRot)
  3348.  
  3349. local BobbingX = -0.5 + walkAnim
  3350.  
  3351. --cameraHandCFrame = cameraHandCFrame:lerp(CFrame.new(1.15*1.3 + (walkAnim/2 - (walkAnim/4)), -1.35*1.3 + camHandY + (-BobbingY/8) + 0, -0.45 + -camHandZ + ((camera.FieldOfView/45)-1.6)*1.3) * CFrame.Angles(math.rad(punchRotXcam), math.rad(punchRotYcam), math.rad(punchRotZcam)) * CFrame.new(0, 0, -1.75) * CFrame.fromEulerAnglesXYZ(math.rad(85), math.rad(55), math.rad(22.5)), 0.25)
  3352. cameraHandCFrame = cameraHandCFrame:lerp( CFrame.new(1.15*1.3 + (BobbingX/3.5), -1.35*1.3 + camHandY + ((0.4-BobbingY)/7) + 0, -0.45 + -camHandZ + ((camera.FieldOfView/45)-1.6)*1.3) * CFrame.Angles(math.rad(punchRotXcam), math.rad(punchRotYcam), math.rad(punchRotZcam)) * CFrame.new(0, 0, -1.75) * CFrame.fromEulerAnglesXYZ(math.rad(85), math.rad(55), math.rad(22.5)), 0.25)
  3353.  
  3354. humOffset = humOffset:lerp(CFrame.new(walkAnim/4 - (walkAnim/8), BobbingY/13, 0), 0.25)
  3355. humanoid.CameraOffset = Vector3.new(humOffset.X, humOffset.Y, 0)
  3356.  
  3357. if camCurrentZoom >= 1.5 then
  3358. cameraHand.Transparency = 1
  3359. for _,t in pairs(cameraHand:GetChildren()) do
  3360. if t.Transparency == 0 then
  3361. t.Transparency = 1
  3362. end
  3363. end
  3364. for _,t in pairs(cameraHandItem:GetChildren()) do
  3365. if t.Transparency == 0 then
  3366. t.Transparency = 1
  3367. end
  3368. end
  3369. else
  3370. changedPerspective = 0
  3371. cameraHand.Transparency = hasItemOnHand
  3372. for _,t in pairs(cameraHand:GetChildren()) do
  3373. if t.Transparency == 1 then
  3374. t.Transparency = hasItemOnHand
  3375. end
  3376. end
  3377. for _,t in pairs(cameraHandItem:GetChildren()) do
  3378. if t.Transparency == 1 then
  3379. t.Transparency = 0
  3380. end
  3381. end
  3382. end
  3383.  
  3384. if updateHand == true then
  3385. updateHand = false
  3386. updateItemOnHand()
  3387. end
  3388.  
  3389. if punching == 1 and punchEnded == 1 then
  3390. punching = 0
  3391. --print("steve uses punch!!")
  3392. local coPunchCam = coroutine.wrap(function()
  3393. local mult = 2.25
  3394. punchRotXcam = 40/2*mult
  3395. punchRotYcam = 25/2*mult
  3396. camHandZ = 2.5
  3397. wait(0.075/4)
  3398. punchRotXcam = 50/2*mult
  3399. punchRotYcam = 25*mult
  3400. punchRotZcam = -10*mult
  3401. camHandZ = 1
  3402. wait(0.075/4)
  3403. punchRotYcam = 50/1.5*mult
  3404. punchRotXcam = -10*mult
  3405. --wait(0.075/2)
  3406. --punchRotYcam = 50
  3407. --punchRotXcam = -10
  3408. wait(0.02)
  3409. punchRotXcam = -20*mult
  3410. wait(0.055)
  3411. camHandZ = 0
  3412. punchRotXcam = 0
  3413. punchRotYcam = 0
  3414. punchRotZcam = 0
  3415. end)
  3416. local coPunch = coroutine.wrap(function()
  3417. punchEnded = 0
  3418. punchSpeed = 1
  3419. punchRotX = -60
  3420. punchRotY = -8
  3421. punchRotZ = -35
  3422.  
  3423. wait(0.075/1.3)
  3424. punchSpeed = 1
  3425. punchRotX = -75
  3426. punchRotY = 8
  3427. punchRotZ = 40
  3428. wait(0.075/1.3)
  3429. punchSpeed = 1
  3430. punchRotX = -20
  3431. punchRotZ = 40
  3432. wait(0.075/1.3)
  3433. punchSpeed = 3.5
  3434. punchRotX = 0
  3435. punchRotY = 0
  3436. punchRotZ = 0
  3437.  
  3438. punchRotXcam = 0
  3439. punchRotYcam = 0
  3440. punchRotZcam = 0
  3441.  
  3442. punchEnded = 1
  3443. wait(0.06/1.3)
  3444. punchSpeed = 0
  3445. end)
  3446. coPunch()
  3447. coPunchCam()
  3448. end
  3449. if ticks > 20 then
  3450. ticks = 0
  3451. if times == 0 then
  3452. times = times + 1
  3453. idleAnimRotX = -1
  3454. idleAnimRotZ = 0
  3455. elseif times == 1 then
  3456. times = times + 1
  3457. idleAnimRotX = -0.75
  3458. idleAnimRotZ = -0.75
  3459. elseif times == 2 then
  3460. times = times + 1
  3461. idleAnimRotX = 0
  3462. idleAnimRotZ = -1
  3463. elseif times == 3 then
  3464. times = times + 1
  3465. idleAnimRotX = 0.75
  3466. idleAnimRotZ = -0.75
  3467. --idleAnimRotX = 0.75
  3468. --idleAnimRotZ = -0
  3469. elseif times == 4 then
  3470. times = times + 1
  3471. idleAnimRotX = 1
  3472. idleAnimRotZ = 0
  3473. --idleAnimRotX = 1
  3474. --idleAnimRotZ = 0
  3475. elseif times == 5 then
  3476. times = times + 1
  3477. idleAnimRotX = 0.75
  3478. idleAnimRotZ = 0.75
  3479. elseif times == 6 then
  3480. times = times + 1
  3481. idleAnimRotX = 0
  3482. idleAnimRotZ = 1
  3483. elseif times == 7 then
  3484. times = 0
  3485. idleAnimRotX = -0.75
  3486. idleAnimRotZ = 0.75
  3487. end
  3488. end
  3489.  
  3490. if hi == 1 then hi = 0 end
  3491. end
  3492. end
  3493. end
  3494. ]],char)
  3495. NLS([[
  3496. local sneaking = 0
  3497. local ticks = 0
  3498. local RS = game:GetService("RunService").RenderStepped
  3499. local player = owner
  3500. local bodyRot = CFrame.new(0, 0, 0)
  3501. local mouse = player:GetMouse()
  3502. mouse.KeyDown:Connect(function(key)
  3503. if key == "q" then
  3504. sneaking = 1
  3505. end
  3506. end)
  3507. mouse.KeyUp:Connect(function(key)
  3508. if key == "q" then
  3509. sneaking = 0
  3510. end
  3511. end)
  3512. char = player.Character
  3513. local head = char:WaitForChild("Head")
  3514. local remoteevent = char:WaitForChild("SteveFunction")
  3515. remoteevent.Name = "SteveEvent"
  3516. local torso = char:WaitForChild("Torso")
  3517. local humanoid = char:WaitForChild("Humanoid")
  3518. humanoid.AutoRotate = false
  3519. neck = torso:WaitForChild("Neck")
  3520. local humRootPart = char:WaitForChild("HumanoidRootPart")
  3521. camera = workspace.CurrentCamera
  3522. local camPart = Instance.new("Part", char)
  3523. camPart.Size = Vector3.new(0, 0, 0)
  3524. camPart.CFrame = camera.CFrame
  3525. camPart.CanCollide = false
  3526. camPart.Anchored = true
  3527. camPart.Transparency = 1
  3528. local lastCamRot = camPart.Orientation
  3529. function AngleDifference(Angle1, Angle2)
  3530. local Difference = {X = 0, Y = 0, Z = 0}
  3531. Difference.X = Angle2.X - Angle1.X
  3532.  
  3533. if (Difference.X > 180) then
  3534. Difference.X = Difference.X - 360
  3535. elseif (Difference.X < -180) then
  3536. Difference.X = Difference.X + 360
  3537. end
  3538.  
  3539. Difference.Y = Angle2.Y - Angle1.Y
  3540.  
  3541. if (Difference.Y > 180) then
  3542. Difference.Y = Difference.Y - 360
  3543. elseif (Difference.Y < -180) then
  3544. Difference.Y = Difference.Y + 360
  3545. end
  3546.  
  3547. Difference.Z = Angle2.Z - Angle1.Z
  3548.  
  3549. if (Difference.Z > 180) then
  3550. Difference.Z = Difference.Z - 360
  3551. elseif (Difference.Z < -180) then
  3552. Difference.Z = Difference.Z + 360
  3553. end
  3554.  
  3555. return Vector3.new(Difference.X, Difference.Y, Difference.Z)
  3556. end
  3557. game:GetService("RunService").RenderStepped:Connect(function()
  3558. local remoteevent = char:WaitForChild("SteveEvent")
  3559. camPart.CFrame = camera.CFrame
  3560. local neckYRot = math.rad(camPart.Orientation.Y - torso.Orientation.Y)
  3561. local rotX = math.deg(math.atan2(humanoid.MoveDirection.Z, humanoid.MoveDirection.X)) + 90
  3562. if humanoid.MoveDirection ~= Vector3.new(0, 0, 0) then
  3563. --print(rotX)
  3564. bodyRot = bodyRot:lerp(CFrame.Angles(0, -math.rad(rotX), 0), 0.125)
  3565. humRootPart.CFrame = CFrame.new(humRootPart.CFrame.p.X, humRootPart.CFrame.p.Y, humRootPart.CFrame.p.Z) * bodyRot
  3566. end
  3567. local neckYRot = math.rad(camPart.Orientation.Y - torso.Orientation.Y)
  3568. neck.C1 = CFrame.new(0, 0.975, 0) * CFrame.fromEulerAnglesXYZ(math.rad(sneaking*45), neckYRot, 0)
  3569. neck.C0 = CFrame.new(0, -0.65, 0) * CFrame.Angles(-math.rad(camPart.Orientation.X - torso.Orientation.X - (sneaking*45)), 0, 0)
  3570.  
  3571. local oldTorsoOrientation = torso.Orientation
  3572. if AngleDifference(camPart.Orientation, torso.Orientation).Y > 45 then
  3573. humRootPart.CFrame = CFrame.new(humRootPart.CFrame.p.X, humRootPart.CFrame.p.Y, humRootPart.CFrame.p.Z) * CFrame.Angles(0, math.rad(head.Orientation.Y + 45), 0)
  3574. bodyRot = CFrame.Angles(0, math.rad(head.Orientation.Y + 45), 0)
  3575. --print("-45")
  3576. elseif AngleDifference(camPart.Orientation, torso.Orientation).Y < -45 then
  3577. humRootPart.CFrame = CFrame.new(humRootPart.CFrame.p.X, humRootPart.CFrame.p.Y, humRootPart.CFrame.p.Z) * CFrame.Angles(0, math.rad(head.Orientation.Y - 45), 0)
  3578. bodyRot = CFrame.Angles(0, math.rad(head.Orientation.Y - 45), 0)
  3579. --print("45")
  3580. end
  3581.  
  3582. lastCamRot = camPart.Orientation
  3583. neck.C1 = neck.C1 * CFrame.fromEulerAnglesXYZ(0, -math.rad(AngleDifference(oldTorsoOrientation, torso.Orientation).Y), 0)
  3584. ticks = ticks + 1
  3585. if owner.Character:WaitForChild("SteveEvent") then
  3586. owner.Character.SteveEvent:FireServer (neck.C0,neck.C1)
  3587. end
  3588. end)
  3589. ]], char)
  3590. local lH = Instance.new("Motor6D", torso)
  3591. lH.Name = "Left Hip"
  3592. lH.Part0 = lLeg
  3593. lH.Part1 = torso
  3594. lH.C0 = CFrame.new(0, 0.975, 0)
  3595. lH.C1 = CFrame.new(0.325, -0.975, 0) * CFrame.Angles(0, 0, 0)
  3596. local rH = Instance.new("Motor6D", torso)
  3597. rH.Name = "Right Hip"
  3598. rH.Part0 = rLeg
  3599. rH.Part1 = torso
  3600. rH.C0 = CFrame.new(0, 0.975, 0)
  3601. rH.C1 = CFrame.new(-0.325, -0.975, 0) * CFrame.Angles(0, -math.rad(0), 0)
  3602.  
  3603. local ticks = 0
  3604. local times = 0
  3605.  
  3606. local walkAnim = 0
  3607. local increaseWalkAnim = 1
  3608.  
  3609. local idleAnimRotX = 0
  3610. local idleAnimRotZ = 0
  3611. local sneaking = 0
  3612.  
  3613.  
  3614.  
  3615. local oldHP = humanoid.Health
  3616.  
  3617. local damageTime = 0
  3618. neededtopunch = false
  3619. punchdelay = false
  3620. local punchRotX = 0
  3621. local punchRotY = 0
  3622. local punchRotZ = 0
  3623. local punchSpeed = 0
  3624. local punching = 0
  3625. local selectedBlock = 0
  3626. local punchEnded = 1
  3627. local itemOnHand = nil
  3628. local selectBox = Instance.new("SelectionBox", char)
  3629. selectBox.Adornee = nil
  3630. selectBox.Transparency = 0.5
  3631. selectBox.Color3 = Color3.new(0, 0, 0)
  3632. selectBox.LineThickness = 0
  3633.  
  3634. local handItem = Instance.new("Part", char)
  3635. handItem.Name = "HandItem"
  3636. handItem.Size = Vector3.new(0.52, 0.52, 0.52)
  3637. handItem.Transparency = 1
  3638. handItem.CanCollide = false
  3639.  
  3640. local handItemWeld = Instance.new("Weld", char)
  3641. handItemWeld.Part0 = handItem
  3642. handItemWeld.Part1 = lArm
  3643. handItemWeld.C1 = CFrame.new(0, -0.9, 0.6) * CFrame.Angles(math.rad(10), math.rad(-45), 0)
  3644.  
  3645. local sound = Instance.new("Sound", char)
  3646. sound.Name = "Hurt"
  3647. sound.Volume = 10
  3648. sound.SoundId = "rbxassetid://3362346832"
  3649. if humanoid.Health < oldHP then
  3650. damageTime = 60
  3651. sound:Play()
  3652. end
  3653. reallyispunching = false
  3654. breakingblock = false
  3655. local facesToResize = {"Front", "Back", "Left", "Right", "Bottom", "Top"}
  3656. Mouse.Button1Down:connect(function()
  3657. neededtopunch = true
  3658. reallyispunching = true
  3659. if Mouse.Target and reallyispunching == true then
  3660. if getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  3661. if Mouse.Target.Name ~= "Baseplate" and Mouse.Target.Name ~= "Debris" and Mouse.Target.Name ~= "Base" then
  3662. local humanoid = Mouse.Target.Parent:FindFirstChildOfClass("Humanoid")
  3663. if humanoid then
  3664. if diamondswordtoggled == false then
  3665. humanoid.Health = humanoid.Health - 10
  3666. else
  3667. humanoid.Health = humanoid.Health - 35
  3668. end
  3669. local parts = Mouse.Target.Parent:GetChildren()
  3670. for _,p in pairs(parts) do
  3671. if p.ClassName == "Part" then
  3672. 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))
  3673. end
  3674. end
  3675. return
  3676. end
  3677. local blkTar = Mouse.Target
  3678. if blkTar and blkTar.Name ~= "TNTBlock" then
  3679. breakingblock = true
  3680. if not workspace:FindFirstChild("BlockCrack") then
  3681. blkTarCrack = Instance.new("Part",workspace)
  3682. blkTarCrack.Name = "BlockCrack"
  3683. blkTarCrack.Transparency = 1
  3684. blkTarCrack.CanCollide = false
  3685. blkTarCrack.Size = blkTar.Size + Vector3.new(0.005,0.005,0.005)
  3686. local blkTarCrackWeld = Instance.new("Weld",blkTarCrack)
  3687. blkTarCrackWeld.Part0 = blkTar
  3688. blkTarCrackWeld.Part1 = blkTarCrack
  3689. end
  3690. coroutine.resume(coroutine.create(function()
  3691. while wait() do
  3692. if breakingblock == false then
  3693. blkTarCrack:Destroy()
  3694. end
  3695. end
  3696. end))
  3697. crack1 = Instance.new("Texture",blkTarCrack)
  3698. crack1.Face = "Left"
  3699. crack1.Texture = "http://www.roblox.com/asset/?id=448916163"
  3700. crack1.Name = "crack"
  3701. crack1.Color3 = Color3.new(0,0,0)
  3702. crack1.StudsPerTileV= 2.605
  3703. crack1.StudsPerTileU= 2.605
  3704. crack2 = Instance.new("Texture",blkTarCrack)
  3705. crack2.Face = "Bottom"
  3706. crack2.Texture = "http://www.roblox.com/asset/?id=448916163"
  3707. crack2.Name = "crack"
  3708. crack2.Color3 = Color3.new(0,0,0)
  3709. crack2.StudsPerTileV= 2.605
  3710. crack2.StudsPerTileU= 2.605
  3711. crack3 = Instance.new("Texture",blkTarCrack)
  3712. crack3.Face = "Top"
  3713. crack3.Texture = "http://www.roblox.com/asset/?id=448916163"
  3714. crack3.Name = "crack"
  3715. crack3.Color3 = Color3.new(0,0,0)
  3716. crack3.StudsPerTileV= 2.605
  3717. crack3.StudsPerTileU= 2.605
  3718. crack4 = Instance.new("Texture",blkTarCrack)
  3719. crack4.Face = "Back"
  3720. crack4.Texture = "http://www.roblox.com/asset/?id=448916163"
  3721. crack4.Name = "crack"
  3722. crack4.Color3 = Color3.new(0,0,0)
  3723. crack4.StudsPerTileV= 2.605
  3724. crack4.StudsPerTileU= 2.605
  3725. crack5 = Instance.new("Texture",blkTarCrack)
  3726. crack5.Face = "Right"
  3727. crack5.Texture = "http://www.roblox.com/asset/?id=448916163"
  3728. crack5.Name = "crack"
  3729. crack5.StudsPerTileV= 2.605
  3730. crack5.StudsPerTileU= 2.605
  3731. crack5.Color3 = Color3.new(0,0,0)
  3732. crack6 = Instance.new("Texture",blkTarCrack)
  3733. crack6.Face = "Front"
  3734. crack6.Texture = "http://www.roblox.com/asset/?id=448916163"
  3735. crack6.Name = "crack"
  3736. crack6.Color3 = Color3.new(0,0,0)
  3737. crack6.StudsPerTileV= 2.605
  3738. crack6.StudsPerTileU= 2.605
  3739. if breakingblock == false then
  3740. blkTarCrack:Destroy()
  3741. end
  3742. for i,v in pairs(blkTarCrack:GetChildren()) do
  3743. if v.Name == "crack" then
  3744. v.Texture = "rbxassetid://448916452"
  3745. end
  3746. end
  3747. wait(0.7)
  3748. for i,v in pairs(blkTarCrack:GetChildren()) do
  3749. if v.Name == "crack" then
  3750. v.Texture = "rbxassetid://448916989"
  3751. end
  3752. end
  3753. wait(0.7)
  3754. for i,v in pairs(blkTarCrack:GetChildren()) do
  3755. if v.Name == "crack" then
  3756. v.Texture = "rbxassetid://448917080"
  3757. end
  3758. end
  3759. if breakingblock == true and blkTarCrack then
  3760. wait(0.7)
  3761. blkTar:Destroy()
  3762. blkTarCrack.Parent = nil
  3763. for i,v in pairs(blkTarCrack:GetChildren()) do
  3764. v:Destroy()
  3765. end
  3766. for i = 1, 9 do
  3767. local part = Instance.new("Part", workspace)
  3768. part.Size = Vector3.new(0, 0, 0)
  3769. part.Transparency = 1
  3770. part.CanCollide = false
  3771. part.Velocity = Vector3.new(math.random(-5, 5), 5, math.random(-5, 5))
  3772. part.Name = "Debris"
  3773.  
  3774. part.CFrame =
  3775. Mouse.Target.CFrame *
  3776. 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))
  3777.  
  3778. part.CustomPhysicalProperties = PhysicalProperties.new(0, 0.2, 0, 100, 100)
  3779.  
  3780. local billboard = Instance.new("BillboardGui", part)
  3781. billboard.Size = UDim2.new(1.2, 0, 1.2, 0)
  3782.  
  3783. local clipDescendant = Instance.new("TextLabel", billboard)
  3784. clipDescendant.Size = UDim2.new(0.5, 0, 0.5, 0)
  3785. clipDescendant.BackgroundTransparency = 1
  3786. clipDescendant.Text = ""
  3787. clipDescendant.ClipsDescendants = true
  3788.  
  3789. local img = Instance.new("ImageLabel", clipDescendant)
  3790. img.Size = UDim2.new(2, 0, 2, 0)
  3791. img.BackgroundTransparency = 1
  3792. img.Position = UDim2.new(math.random(-70, 70)/100, 0, math.random(-70, 70)/100, 0)
  3793.  
  3794. local tex = blkTar:FindFirstChild("Front")
  3795. if tex then
  3796. img.Image = tex.Texture
  3797. else
  3798. img.Image = "rbxassetid://744949545"
  3799. end
  3800.  
  3801. if img.Image == "rbxassetid://744949545" then
  3802. img.ImageColor3 = blkTar.Color
  3803. end
  3804.  
  3805. part.Touched:connect(function(prt)
  3806. if prt ~= blkTar then
  3807. part.CanCollide = true
  3808. end
  3809. end)
  3810.  
  3811. coroutine.resume(coroutine.create(function()
  3812. wait(math.random(50, 65)/100)
  3813. part:Destroy()
  3814. end))
  3815. --part.Anchored = false
  3816. end
  3817. end
  3818.  
  3819. while wait() do
  3820. if breakingblock == false then
  3821. blkTarCrack:Destroy()
  3822. end
  3823. end
  3824. end
  3825.  
  3826. local humanoid = Mouse.Target.Parent:FindFirstChild("Humanoid")
  3827. if humanoid then
  3828. humanoid.Health = humanoid.Health - damage
  3829. --humanoid.Health:TakeDamage(10)
  3830. local parts = Mouse.Target.Parent:GetChildren()
  3831. for _,p in pairs(parts) do
  3832. if p.ClassName == "Part" then
  3833. 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))
  3834. end
  3835. end
  3836. return
  3837. end
  3838. local x = Mouse.Target.CFrame.p.X
  3839. local y = Mouse.Target.CFrame.p.Y
  3840. local z = Mouse.Target.CFrame.p.Z
  3841. if Mouse.TargetSurface.Name == "Right" then x = x + 2.6 end
  3842. if Mouse.TargetSurface.Name == "Left" then x = x - 2.6 end
  3843. if Mouse.TargetSurface.Name == "Top" then y = y + 2.6 end
  3844. if Mouse.TargetSurface.Name == "Bottom" then y = y - 2.6 end
  3845. if Mouse.TargetSurface.Name == "Back" then z = z + 2.6 end
  3846. if Mouse.TargetSurface.Name == "Front" then z = z - 2.6 end
  3847. if Mouse.Target.Size.X > 2.6 or Mouse.Target.Size.Y > 2.6 or Mouse.Target.Size.Z > 2.6 then
  3848. x = Mouse.Hit.p.X
  3849. y = Mouse.Hit.p.Y
  3850. z = Mouse.Hit.p.Z
  3851. end
  3852. -- local x = round(math.abs(mouseX)/2.6)*2.6
  3853. -- local y = round(math.abs(mouseY)/2.6)*2.6
  3854. -- local z = round(math.abs(mouseZ)/2.6)*2.6
  3855. -- if Mouse.Hit.p.X < 0 then x = x * -1 end
  3856. -- if Mouse.Hit.p.Y < 0 then y = y * -1 end
  3857. -- if Mouse.Hit.p.Z < 0 then z = z * -1 end
  3858. end
  3859. end
  3860. end
  3861. end)
  3862. Mouse.Button1Up:connect(function()
  3863. reallyispunching = false
  3864. breakingblock = false
  3865. neededtopunch = false
  3866. end)
  3867. signremote = Instance.new("RemoteEvent",char)
  3868. signremote.Name = "SignRemote"
  3869. function placeSign()
  3870. thesignguiisthere = true
  3871. local signgui = Instance.new("ScreenGui",player.PlayerGui)
  3872. local Frame = Instance.new("Frame",signgui)
  3873. local closebutton = Instance.new("TextButton",Frame)
  3874. local signguitext = Instance.new("TextBox",Frame)
  3875. Frame.BackgroundTransparency = 1
  3876. Frame.Size = UDim2.new(1, 0,1, 0)
  3877. Frame.Position = UDim2.new(0, 0,0, 0)
  3878. signguitext.PlaceholderText = "Text Here for sign"
  3879. signguitext.ClearTextOnFocus = false
  3880. signguitext.Font = "Arcade"
  3881. signguitext.Position = UDim2.new(0, 50,0, -1)
  3882. signguitext.Size = UDim2.new(1, 0,0.50, 0)
  3883. signguitext.TextColor3 = Color3.fromRGB(255, 255, 255)
  3884. signguitext.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
  3885. signguitext.TextStrokeTransparency = 1
  3886. signguitext.BackgroundTransparency = 0.5
  3887. signguitext.TextSize = 100
  3888. signguitext.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  3889. closebutton.Text = "close sign gui"
  3890. closebutton.Font = "Arcade"
  3891. closebutton.Position = UDim2.new(0, 1,0, 1)
  3892. closebutton.Size = UDim2.new(0.10, 0,0.10, 0)
  3893. closebutton.TextColor3 = Color3.fromRGB(255, 255, 255)
  3894. closebutton.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
  3895. closebutton.TextStrokeTransparency = 1
  3896. closebutton.BackgroundTransparency = 0
  3897. closebutton.TextScaled = true
  3898. closebutton.BackgroundColor3 = Color3.fromRGB(255, 148, 148)
  3899. closebutton.MouseButton1Click:Connect(function()
  3900. signgui:Destroy()
  3901. thesignguiisthere = false
  3902. end)
  3903. local signmodel = Instance.new("Model",workspace:WaitForChild("Signs"))
  3904. local Signpart1 = Instance.new("Part", signmodel)
  3905. putTexture(Signpart1, "rbxassetid://3258599312", "rbxassetid://3258599312",
  3906. "rbxassetid://3258599312","rbxassetid://3258599312",
  3907. "rbxassetid://3258599312","rbxassetid://3258599312", "Texture")
  3908. Signpart1.Anchored = true
  3909. Signpart1.Size = Vector3.new(0.332, 1.83, 0.332)
  3910. local Signpart2 = Instance.new("Part", signmodel)
  3911. putTexture(Signpart2, "rbxassetid://152572161", "rbxassetid://152572161",
  3912. "rbxassetid://152572161","rbxassetid://152572161",
  3913. "rbxassetid://152572161","rbxassetid://152572161", "Texture")
  3914. Signpart2.Anchored = false
  3915. local signtext = Instance.new("SurfaceGui",Signpart2)
  3916. local signtext2 = Instance.new("TextLabel",signtext)
  3917. signtext.Face = "Back"
  3918. Signpart2.Size = Vector3.new(2.988, 1.996, 0.332)
  3919. signtext2.Size = UDim2.new(1,0,1,0)
  3920. signtext2.BackgroundTransparency = 1
  3921. signtext2.TextSize = 100
  3922. signtext2.Font = "Arcade"
  3923. signremote.OnServerEvent:Connect(function(b1)
  3924. signtext2.Text = b1
  3925. end)
  3926. Signpart1.CFrame = torso.CFrame * CFrame.new(0,-torso.Size.Y,-3)
  3927. for _,f in pairs(facesToResize) do
  3928. Signpart1:WaitForChild(f).StudsPerTileU = 2.6
  3929. Signpart1:WaitForChild(f).StudsPerTileV = 2.6
  3930. end
  3931. for _,f in pairs(facesToResize) do
  3932. Signpart2:WaitForChild(f).StudsPerTileU = 2.6
  3933. Signpart2:WaitForChild(f).StudsPerTileV = 2.6
  3934. end
  3935. wait(0.00)
  3936. Signpart1.Anchored = true
  3937. Signpart1.CFrame = CFrame.new(SnapToGrid(Signpart1.CFrame.X, 2.6), SnapToGrid(Signpart1.CFrame.Y, 2.6), SnapToGrid(Signpart1.CFrame.Z, 2.6))
  3938. Signpart1.Orientation = Vector3.new(0,torso.Orientation.Y,0)
  3939. signweld = Instance.new("Weld",Signpart1)
  3940. signweld.Part0 = Signpart1
  3941. signweld.Part1 = Signpart2
  3942. signweld.C0 = CFrame.new(0, 1.91, 0)
  3943. NLS([[
  3944. script.Parent.Changed:Connect(function()
  3945. signremote = script.Parent.Parent.Parent.Parent.Parent.Character:WaitForChild("SignRemote")
  3946. signremote:FireServer(script.Parent.Text,)
  3947. end)
  3948. ]],signguitext)
  3949. while thesignguiisthere == true do
  3950. signtext2.Text = signguitext.Text
  3951. wait(0.00)
  3952. end
  3953. end
  3954. function placeBlock(block, cFPos)
  3955. local blockPlaced = Instance.new("Part", workspace)
  3956. if block.name ~= "TNT" then
  3957. blockPlaced.Material = "Granite"
  3958. else
  3959. blockPlaced.Material = "SmoothPlastic"
  3960. end
  3961. blockPlaced.Anchored = false
  3962. blockPlaced.Size = block.size
  3963. blockPlaced.CFrame = cFPos
  3964. if block.name ~= "TNT" then
  3965. blockPlaced.Transparency = 1
  3966. end
  3967. local blockvalue = Instance.new("BoolValue",blockPlaced)
  3968. blockvalue.Name = "IsBlock"
  3969. blockvalue.Value = true
  3970. if block.name == "TNT" then
  3971. Part0 = blockPlaced
  3972. Part0.Anchored = true
  3973. Decal1 = Instance.new("Decal")
  3974. Decal2 = Instance.new("Decal")
  3975. Decal3 = Instance.new("Decal")
  3976. Decal4 = Instance.new("Decal")
  3977. Decal5 = Instance.new("Decal")
  3978. Decal6 = Instance.new("Decal")
  3979. Sound8 = Instance.new("Sound")
  3980. Sound9 = Instance.new("Sound")
  3981. Camera10 = Instance.new("Camera")
  3982. ParticleEmitter11 = Instance.new("ParticleEmitter")
  3983. Part0.Name = "TNTBlock"
  3984. Part0.Color = Color3.new(0.972549, 0.972549, 0.972549)
  3985. Part0.Size = Vector3.new(3, 3, 3)
  3986. Part0.BottomSurface = Enum.SurfaceType.Smooth
  3987. Part0.BrickColor = BrickColor.new("Institutional white")
  3988. Part0.Material = Enum.Material.Fabric
  3989. Part0.TopSurface = Enum.SurfaceType.Smooth
  3990. Part0.brickColor = BrickColor.new("Institutional white")
  3991. Part0.Anchored = true
  3992. Decal1.Name = "TNT Bottom"
  3993. Decal1.Parent = Part0
  3994. Decal1.Texture = "http://www.roblox.com/asset/?id=118557091"
  3995. Decal1.Face = Enum.NormalId.Bottom
  3996. Decal2.Name = "TNT TOP"
  3997. Decal2.Parent = Part0
  3998. Decal2.Texture = "http://www.roblox.com/asset/?id=2748239465"
  3999. Decal2.Face = Enum.NormalId.Top
  4000. Decal3.Name = "tnt side"
  4001. Decal3.Parent = Part0
  4002. Decal3.Texture = "http://www.roblox.com/asset/?id=3891642918"
  4003. Decal3.Face = Enum.NormalId.Right
  4004. Decal4.Name = "tnt side"
  4005. Decal4.Parent = Part0
  4006. Decal4.Texture = "http://www.roblox.com/asset/?id=3891642918"
  4007. Decal5.Name = "tnt side"
  4008. Decal5.Parent = Part0
  4009. Decal5.Texture = "http://www.roblox.com/asset/?id=3891642918"
  4010. Decal5.Face = Enum.NormalId.Left
  4011. Decal6.Name = "tnt side"
  4012. Decal6.Parent = Part0
  4013. Decal6.Texture = "http://www.roblox.com/asset/?id=3891642918"
  4014. Decal6.Face = Enum.NormalId.Back
  4015. local fuse = 0.5
  4016. Sound8.Name = "Creeper Hissing"
  4017. Sound8.Parent = Part0
  4018. Sound8.SoundId = "rbxassetid://907668984"
  4019. Sound9.Name = "TNT_BOOM"
  4020. Sound9.Parent = Part0
  4021. Sound9.TimePosition = 2
  4022. Sound9.SoundId = "rbxassetid://3542426596"
  4023. Camera10.Name = "ThumbnailCamera"
  4024. Camera10.Parent = Part0
  4025. Camera10.CFrame = CFrame.new(-83.3922195, 4.62437677, 36.390995, -0.703318119, -0.36768654, 0.608399868, 1.49011594e-08, 0.855846167, 0.51723069, -0.710875332, 0.363777727, -0.601932049)
  4026. Camera10.CoordinateFrame = CFrame.new(-83.3922195, 4.62437677, 36.390995, -0.703318119, -0.36768654, 0.608399868, 1.49011594e-08, 0.855846167, 0.51723069, -0.710875332, 0.363777727, -0.601932049)
  4027. Camera10.Focus = CFrame.new(-84.6090164, 3.5899179, 37.5948563, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  4028. Camera10.focus = CFrame.new(-84.6090164, 3.5899179, 37.5948563, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  4029. ParticleEmitter11.Parent = Part0
  4030. ParticleEmitter11.Speed = NumberRange.new(9, 9)
  4031. ParticleEmitter11.Enabled = false
  4032. ParticleEmitter11.Texture = "rbxassetid://1494734425"
  4033. ParticleEmitter11.Size = NumberSequence.new(4,4)
  4034. ParticleEmitter11.Lifetime = NumberRange.new(1, 1)
  4035. ParticleEmitter11.Rate = 500
  4036. ParticleEmitter11.SpreadAngle = Vector2.new(3050, 30)
  4037. ParticleEmitter11.VelocitySpread = 3050
  4038. de = Instance.new("ClickDetector",Part0)
  4039. de.MouseClick:Connect(function()
  4040. Part0.Anchored = false
  4041. Part0.Velocity = Vector3.new(math.random(-5,5),10,math.random(-5,5))
  4042. Part0["Creeper Hissing"]:Play()
  4043. for i = 0,15 do
  4044. for i,v in pairs(Part0:GetChildren()) do
  4045. if v.ClassName == "Decal" then
  4046. v.Transparency = 1
  4047. end
  4048. end
  4049. Part0.Material = "SmoothPlastic"
  4050. wait(fuse)
  4051. for i,v in pairs(Part0:GetChildren()) do
  4052. if v.ClassName == "Decal" then
  4053. v.Transparency = 0
  4054. end
  4055. end
  4056. Part0.Material = "Fabric"
  4057. fuse = fuse - 0.07
  4058. if fuse <= 0.25 then
  4059. Part0.Size = Part0.Size + Vector3.new(0.1,0.1,0.1)
  4060. end
  4061. wait(fuse)
  4062. end
  4063. local explosion = Instance.new("Explosion",workspace)
  4064. explosion.BlastPressure = 400000
  4065. explosion.BlastRadius = 5 * Part0.Size.Y
  4066. explosion.Position = Part0.Position
  4067. explosion.Hit:Connect(function(blkTar)
  4068. if blkTar ~= Part0 then
  4069. if blkTar.Parent:FindFirstChildOfClass("Humanoid") then
  4070. blkTar.Parent:FindFirstChildOfClass("Humanoid").Health = blkTar.Parent:FindFirstChildOfClass("Humanoid").Health - 39
  4071. else
  4072. blkTar:Destroy()
  4073. end
  4074. end
  4075. end)
  4076. Part0.Anchored = true
  4077. Part0.Transparency = 1
  4078. for i,v in pairs(Part0:GetChildren()) do
  4079. if v.ClassName == "Decal" then
  4080. v.Transparency = 1
  4081. end
  4082. end
  4083. Part0.CanCollide = false
  4084. Part0.TNT_BOOM:Play()
  4085. --Part0.TNT_BOOM.PlaybackSpeed = math.random(0,1).."."..math.random(0,9)
  4086. smoke = Part0.ParticleEmitter
  4087. smoke.Enabled = true
  4088. wait(0.07)
  4089.  
  4090. smoke.Enabled = false
  4091. wait(1)
  4092. Part0:Destroy()
  4093. end)
  4094. end
  4095. if block.hasGravity == true then
  4096. local connectedTo = Instance.new("ObjectValue", blockPlaced)
  4097. connectedTo.Name = "ConnectedTo"
  4098. blockPlaced.Anchored = false
  4099. blockPlaced.CanCollide = false
  4100. local detector = Instance.new("Part", workspace:WaitForChild("Camera"))
  4101. detector.Transparency = 1
  4102. detector.CanCollide = false
  4103. detector.Size = Vector3.new(1, 0, 1)
  4104. local weldDetector = Instance.new("Motor6D", detector)
  4105. weldDetector.Part0 = detector
  4106. weldDetector.Part1 = blockPlaced
  4107. weldDetector.C1 = CFrame.new(0, -blockPlaced.Size.Y/2, 0)
  4108. local landed = false
  4109. local function fallingBlock()
  4110. coroutine.resume(coroutine.create(function()
  4111. local falling = blockPlaced:FindFirstChild("IsFalling") or Instance.new("CFrameValue", blockPlaced)
  4112. falling.Name = "IsFalling"
  4113. local grav = 0
  4114. while RS:wait() do
  4115. if landed then falling:Destroy() break end
  4116. grav = math.max(-1, grav - 0.0025)
  4117. --blockPlaced.CFrame = CFrame.new(cFPos.X, blockPlaced.CFrame.Y + grav, cFPos.Z)
  4118. end
  4119. end))
  4120. end
  4121. fallingBlock()
  4122. detector.Touched:connect(function(part)
  4123. if blockPlaced.Anchored == false and part ~= blockPlaced and part.Name ~= "Debris" and part:FindFirstChild("IsFalling") == nil and findHumanoid(part) == nil then
  4124. landed = true
  4125. blockPlaced.CanCollide = true
  4126. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  4127. blockPlaced.Anchored = true
  4128. connectedTo.Value = part
  4129. local yOrigin = part.CFrame.Y + (blockPlaced.Size.Y/2) + (part.Size.Y/2)
  4130. blockPlaced.CFrame = CFrame.new(cFPos.X, yOrigin, cFPos.Z)
  4131. --detector:Destroy()
  4132. local falling = false
  4133. part.Changed:connect(function()
  4134. if part.Position.Y ~= yOrigin and falling == false then
  4135. falling = true
  4136. wait(0.075)
  4137. landed = false
  4138. blockPlaced.Anchored = false
  4139. blockPlaced.CanCollide = false
  4140. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  4141. fallingBlock()
  4142. falling = false
  4143. end
  4144. end)
  4145. workspace.ChildRemoved:connect(function()
  4146. --print("hi")
  4147. if connectedTo.Value.Parent == nil and falling == false then
  4148. falling = true
  4149. landed = false
  4150. blockPlaced.Anchored = false
  4151. blockPlaced.CanCollide = false
  4152. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  4153. fallingBlock()
  4154. end
  4155. end)
  4156. end
  4157. end)
  4158. end
  4159. if block.name ~= "TNT" then
  4160. putTexture(blockPlaced, block.frontTex, block.backTex,
  4161. block.topTex, block.bottomTex, block.leftTex, block.rightTex, "Texture")
  4162. end
  4163. local blockSound = Instance.new("Sound", blockPlaced)
  4164. blockSound.SoundId = block.sound
  4165. blockSound.Volume = block.soundVol
  4166. blockSound.Pitch = math.random(95, 105)/100
  4167. blockSound.PlayOnRemove = true
  4168. blockSound:Play()
  4169. return blockPlaced
  4170. end
  4171. Mouse.KeyDown:Connect(function(key)
  4172. if key == "b" then
  4173. if not workspace:FindFirstChild("Blocks") then
  4174. local folder = Instance.new("Folder",workspace)
  4175. folder.Name = "Blocks"
  4176. end
  4177. if punchEnded == 1 then punching = 1 end
  4178. if getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  4179. local x = Mouse.Hit.p.X
  4180. local y = Mouse.Hit.p.Y
  4181. local z = Mouse.Hit.p.Z
  4182. local blk = placeBlock(toolBar[selectedBlock + 1], CFrame.new(x, y, z))
  4183. blk.Parent = workspace:WaitForChild("Blocks")
  4184. for _,f in pairs(facesToResize) do
  4185. blk:WaitForChild(f).StudsPerTileU = 2.6
  4186. blk:WaitForChild(f).StudsPerTileV = 2.6
  4187. end
  4188. wait(0.03)
  4189. BodyForce:Destroy()
  4190. blk.Anchored = true
  4191. blk.CFrame = CFrame.new(SnapToGrid(blk.CFrame.X, 2.6), SnapToGrid(blk.CFrame.Y, 2.6), SnapToGrid(blk.CFrame.Z, 2.6))
  4192. end
  4193. end
  4194. end)
  4195. diamondswordselected = false
  4196. function snap(part)
  4197. coroutine.resume(coroutine.create(function()
  4198. part.Name = "Dust"
  4199. part.Anchored = true
  4200. part.CanCollide = true
  4201. local smoke = Instance.new("ParticleEmitter", part)
  4202. smoke.Size = NumberSequence.new({
  4203. NumberSequenceKeypoint.new(0, 0.6),
  4204. NumberSequenceKeypoint.new(1, 0.6)
  4205. })
  4206. coroutine.resume(coroutine.create(function()
  4207. while wait(0.1) do
  4208. part.Transparency = part.Transparency + 1
  4209. end
  4210. end))
  4211. smoke.Texture = "rbxassetid://1494734425"
  4212. smoke.Rate = 100
  4213. smoke.Lifetime = NumberRange.new(0.6, 1.2)
  4214. smoke.Speed = NumberRange.new(2, 5)
  4215. smoke.SpreadAngle = Vector2.new(-30, 30)
  4216.  
  4217. wait(0.07)
  4218.  
  4219. smoke.Enabled = false
  4220.  
  4221. wait(2)
  4222.  
  4223. part:Destroy()
  4224. end))
  4225. end
  4226. Mouse.KeyDown:Connect(function(key)
  4227. if key == "n" and player.Name == "ManSolomon" or player.Name == "noah878788" then
  4228. if Mouse.Target.Parent.ClassName == "Accessory" then
  4229. accessory = Mouse.Target.Parent
  4230. if accessory.Parent:FindFirstChildOfClass("Humanoid") and not accessory.Parent:FindFirstChildOfClass("Humanoid").Name == "SteveVR" then
  4231. local snapped = accessory.Parent
  4232. snapped:FindFirstChildOfClass("Humanoid").Health = 0
  4233. if snapped:FindFirstChildOfClass("Humanoid").RigType == Enum.HumanoidRigType.R15 then
  4234. snap(snapped.Head)
  4235. wait()
  4236. for i,v in pairs(snapped:GetChildren()) do
  4237. if v.ClassName == "Accessory" then
  4238. snap(v.Handle)
  4239. end
  4240. end
  4241. snap(snapped.RightUpperArm)
  4242. wait()
  4243. snap(snapped.UpperTorso)
  4244. wait()
  4245. snap(snapped.RightLowerArm)
  4246. wait()
  4247. snap(snapped.LeftUpperArm)
  4248. wait()
  4249. snap(snapped.LowerTorso)
  4250. wait()
  4251. snap(snapped.RightHand)
  4252. wait()
  4253. snap(snapped.LeftLowerArm)
  4254. wait()
  4255. snap(snapped.RightUpperLeg)
  4256. wait()
  4257. snap(snapped.LeftHand)
  4258. wait()
  4259. snap(snapped.RightLowerLeg)
  4260. wait()
  4261. snap(snapped.LeftUpperLeg)
  4262. wait()
  4263. snap(snapped.RightFoot)
  4264. wait()
  4265. snap(snapped.LeftLowerLeg)
  4266. wait()
  4267. snap(snapped.LeftFoot)
  4268. else
  4269. snap(snapped.Head)
  4270. wait()
  4271. for i,v in pairs(snapped:GetChildren()) do
  4272. if v.ClassName == "Accessory" then
  4273. snap(v.Handle)
  4274. end
  4275. end
  4276. snap(snapped["Right Arm"])
  4277. wait()
  4278. snap(snapped.Torso)
  4279. wait()
  4280. snap(snapped["Right Leg"])
  4281. wait()
  4282. snap(snapped["Left Arm"])
  4283. wait()
  4284. snap(snapped["Left Leg"])
  4285. end
  4286. end
  4287. end
  4288. if Mouse.Target.Parent:FindFirstChildOfClass("Humanoid") and accessory.Parent:FindFirstChildOfClass("Humanoid").Name ~= "SteveVR" then
  4289. local snapped = Mouse.Target.Parent
  4290. snapped:FindFirstChildOfClass("Humanoid").Health = 0
  4291. if snapped:FindFirstChildOfClass("Humanoid").RigType == Enum.HumanoidRigType.R15 then
  4292. snap(snapped.Head)
  4293. wait()
  4294. for i,v in pairs(snapped:GetChildren()) do
  4295. if v.ClassName == "Accessory" then
  4296. snap(v.Handle)
  4297. end
  4298. end
  4299. snap(snapped.RightUpperArm)
  4300. wait()
  4301. snap(snapped.UpperTorso)
  4302. wait()
  4303. snap(snapped.RightLowerArm)
  4304. wait()
  4305. snap(snapped.LeftUpperArm)
  4306. wait()
  4307. snap(snapped.LowerTorso)
  4308. wait()
  4309. snap(snapped.RightHand)
  4310. wait()
  4311. snap(snapped.LeftLowerArm)
  4312. wait()
  4313. snap(snapped.RightUpperLeg)
  4314. wait()
  4315. snap(snapped.LeftHand)
  4316. wait()
  4317. snap(snapped.RightLowerLeg)
  4318. wait()
  4319. snap(snapped.LeftUpperLeg)
  4320. wait()
  4321. snap(snapped.RightFoot)
  4322. wait()
  4323. snap(snapped.LeftLowerLeg)
  4324. wait()
  4325. snap(snapped.LeftFoot)
  4326. else
  4327. snap(snapped.Head)
  4328. wait()
  4329. for i,v in pairs(snapped:GetChildren()) do
  4330. if v.ClassName == "Accessory" then
  4331. snap(v.Handle)
  4332. end
  4333. end
  4334. snap(snapped["Right Arm"])
  4335. wait()
  4336. snap(snapped.Torso)
  4337. wait()
  4338. snap(snapped["Right Leg"])
  4339. wait()
  4340. snap(snapped["Left Arm"])
  4341. wait()
  4342. snap(snapped["Left Leg"])
  4343. end
  4344. end
  4345. end
  4346. end)
  4347. Mouse.KeyDown:Connect(function(key)
  4348. if key == "j" and player.Name == "ManSolomon" or player.Name == "noah878788" then
  4349. for i,v in pairs(game.Workspace:GetChildren()) do
  4350. if v:FindFirstChildOfClass("Humanoid") and v.Name ~= player.Name and v:FindFirstChildOfClass("Humanoid").Name ~= "SteveVR" then
  4351. coroutine.resume(coroutine.create(function()
  4352. local snapped = v
  4353. snapped:FindFirstChildOfClass("Humanoid").Health = 0
  4354. if snapped:FindFirstChildOfClass("Humanoid").RigType == Enum.HumanoidRigType.R15 then
  4355. snap(snapped.Head)
  4356. wait()
  4357. for i,v in pairs(snapped:GetChildren()) do
  4358. if v.ClassName == "Accessory" then
  4359. snap(v.Handle)
  4360. end
  4361. end
  4362. snap(snapped.RightUpperArm)
  4363. wait()
  4364. snap(snapped.UpperTorso)
  4365. wait()
  4366. snap(snapped.RightLowerArm)
  4367. wait()
  4368. snap(snapped.LeftUpperArm)
  4369. wait()
  4370. snap(snapped.LowerTorso)
  4371. wait()
  4372. snap(snapped.RightHand)
  4373. wait()
  4374. snap(snapped.LeftLowerArm)
  4375. wait()
  4376. snap(snapped.RightUpperLeg)
  4377. wait()
  4378. snap(snapped.LeftHand)
  4379. wait()
  4380. snap(snapped.RightLowerLeg)
  4381. wait()
  4382. snap(snapped.LeftUpperLeg)
  4383. wait()
  4384. snap(snapped.RightFoot)
  4385. wait()
  4386. snap(snapped.LeftLowerLeg)
  4387. wait()
  4388. snap(snapped.LeftFoot)
  4389. else
  4390. snap(snapped.Head)
  4391. wait()
  4392. for i,v in pairs(snapped:GetChildren()) do
  4393. if v.ClassName == "Accessory" then
  4394. snap(v.Handle)
  4395. end
  4396. end
  4397. snap(snapped["Right Arm"])
  4398. wait()
  4399. snap(snapped.Torso)
  4400. wait()
  4401. snap(snapped["Right Leg"])
  4402. wait()
  4403. snap(snapped["Left Arm"])
  4404. wait()
  4405. snap(snapped["Left Leg"])
  4406. end
  4407. end))
  4408. end
  4409. end
  4410. end
  4411. end)
  4412. Mouse.KeyDown:Connect(function(key)
  4413. if key == "p" then
  4414. if not workspace:FindFirstChild("Signs") then
  4415. local folder = Instance.new("Folder",workspace)
  4416. folder.Name = "Signs"
  4417. end
  4418. if punchEnded == 1 then punching = 1 end
  4419. if getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  4420. local x = Mouse.Hit.p.X
  4421. local y = Mouse.Hit.p.Y
  4422. local z = Mouse.Hit.p.Z
  4423. placeSign()
  4424. end
  4425. end
  4426. end)
  4427. Mouse.KeyDown:Connect(function(key)
  4428. if key == "p" then
  4429. if not workspace:FindFirstChild("Signs") then
  4430. local folder = Instance.new("Folder",workspace)
  4431. folder.Name = "Signs"
  4432. end
  4433. if punchEnded == 1 then punching = 1 end
  4434. if getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  4435. local x = Mouse.Hit.p.X
  4436. local y = Mouse.Hit.p.Y
  4437. local z = Mouse.Hit.p.Z
  4438. placeSign()
  4439. end
  4440. end
  4441. end)
  4442. diamondswordtoggled = false
  4443. Mouse.KeyDown:Connect(function(key)
  4444. if key == "f" then
  4445. if diamondswordtoggled == true then
  4446. diamondswordtoggled = false
  4447. else
  4448. diamondswordtoggled = true
  4449. end
  4450. end
  4451. end)
  4452.  
  4453. local changedItem = false
  4454. local hasItemOnHand = 0
  4455. local hi = 0
  4456. -- selection thingy
  4457. local selectLabel = Instance.new("TextLabel", gui)
  4458. selectLabel.Size = UDim2.new(0, 32, 0, 32)
  4459. selectLabel.Position = UDim2.new(0.5, -160 + (selectedBlock*40), 1, -105)
  4460. selectLabel.BackgroundTransparency = 1
  4461. selectLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  4462. selectLabel.BorderSizePixel = 0
  4463. selectLabel.Text = ""
  4464. selectLabel.ZIndex = 3
  4465. makeSquare(UDim2.new(0, -2, 0, 0), UDim2.new(0, 2, 0, 32),
  4466. Color3.new(88/255, 102/255, 85/255), 0, selectLabel, 3)
  4467. makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 32, 0, 2),
  4468. Color3.new(88/255, 102/255, 85/255), 0, selectLabel, 3)
  4469. makeSquare(UDim2.new(0, -2, 0, 32), UDim2.new(0, 36, 0, 2),
  4470. Color3.new(212/255, 231/255, 207/255), 0, selectLabel, 3)
  4471. makeSquare(UDim2.new(0, 32, 0, 0), UDim2.new(0, 2, 0, 32),
  4472. Color3.new(212/255, 231/255, 207/255), 0, selectLabel, 3)
  4473. makeSquare(UDim2.new(0, 34, 0, -4), UDim2.new(0, 2, 0, 40),
  4474. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  4475. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 2, 0, 40),
  4476. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  4477. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 40, 0, 2),
  4478. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  4479. makeSquare(UDim2.new(0, 32, 0, -2), UDim2.new(0, 2, 0, 2),
  4480. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  4481. makeSquare(UDim2.new(0, -4, 0, 34), UDim2.new(0, 40, 0, 2),
  4482. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  4483. makeSquare(UDim2.new(0, -6, 0, -6), UDim2.new(0, 2, 0, 42),
  4484. Color3.new(212/255, 231/255, 207/255), 0, selectLabel, 3)
  4485. makeSquare(UDim2.new(0, -6, 0, -6), UDim2.new(0, 42, 0, 2),
  4486. Color3.new(212/255, 231/255, 207/255), 0, selectLabel, 3)
  4487. makeSquare(UDim2.new(0, 36, 0, -4), UDim2.new(0, 2, 0, 40),
  4488. Color3.new(88/255, 102/255, 85/255), 0, selectLabel, 3)
  4489. makeSquare(UDim2.new(0, 36, 0, -6), UDim2.new(0, 2, 0, 2),
  4490. Color3.new(163/255, 180/255, 159/255), 0, selectLabel, 3)
  4491. makeSquare(UDim2.new(0, 38, 0, -6), UDim2.new(0, 2, 0, 44),
  4492. Color3.new(0/255, 0/255, 0/255), 0.3, selectLabel, 3)
  4493. makeSquare(UDim2.new(0, -8, 0, -6), UDim2.new(0, 2, 0, 44),
  4494. Color3.new(0/255, 0/255, 0/255), 0.3, selectLabel, 3)
  4495. makeSquare(UDim2.new(0, -8, 0, -8), UDim2.new(0, 48, 0, 2),
  4496. Color3.new(0/255, 0/255, 0/255), 0, selectLabel, 3)
  4497. --
  4498. Mouse.KeyDown:connect(function(key)
  4499. if key == "q" then
  4500. sneaking = 1
  4501. humanoid.WalkSpeed = humanoid.WalkSpeed / 2
  4502. rootJoint.C1 = CFrame.Angles(math.rad(sneaking*45), 0, 0)
  4503.  
  4504. --neck.C1 = CFrame.Angles(-math.rad(torso.Orientation.X - (sneaking*25)), 0, 0)
  4505. lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*45), 0, 0)
  4506. rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  4507. --print("Sneaking...")
  4508. end
  4509. if key == "r" then
  4510. if creativeInventoryGUI.Visible == true then
  4511. creativeInventoryGUI.Visible = false
  4512. elseif creativeInventoryGUI.Visible == false then
  4513. creativeInventoryGUI.Visible = true
  4514. end
  4515. end
  4516. if key == "e" then
  4517. if selectedBlock == 8 then
  4518. selectedBlock = -1
  4519. diamondswordtoggled = false
  4520. end
  4521. selectedBlock = selectedBlock + 1
  4522. diamondswordtoggled = false
  4523. itemOnHand = toolBar[selectedBlock + 1]
  4524. if selectedBlock > 7 then
  4525. for _,d in pairs(handItem:GetChildren()) do
  4526. d:Destroy()
  4527. end
  4528. handItem.Transparency = 1
  4529. end
  4530. if selectedBlock < 7 then
  4531. for _,d in pairs(handItem:GetChildren()) do
  4532. d:Destroy()
  4533. end
  4534. putTexture(handItem, itemOnHand.frontTex, itemOnHand.backTex,
  4535. itemOnHand.topTex, itemOnHand.bottomTex,
  4536. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  4537. for _,f in pairs(facesToResize) do
  4538. handItem:WaitForChild(f).StudsPerTileU = 0.52
  4539. handItem:WaitForChild(f).StudsPerTileV = 0.52
  4540. end
  4541. elseif selectedBlock > 7 then
  4542. for _,d in pairs(handItem:GetChildren()) do
  4543. d:Destroy()
  4544. end
  4545. if hasItemOnHand == 1 then hi = 1 end
  4546. end
  4547. end
  4548. end)
  4549. Mouse.KeyDown:connect(function(key)
  4550. if (key == "0" or key == "1" or key == "2"
  4551. or key == "3" or key == "4" or key == "5"
  4552. or key == "6" or key == "7") and hasItemOnHand == 0 then hi = 1 end
  4553. selectLabel.Position = UDim2.new(0.5, -160 + ((selectedBlock)*40), 1, -105)
  4554. end)
  4555.  
  4556.  
  4557. Mouse.KeyUp:connect(function(key)
  4558. if key == "q" then
  4559. sneaking = 0
  4560. humanoid.WalkSpeed = humanoid.WalkSpeed * 2
  4561. humanoid.HipHeight = 0.3
  4562. rootJoint.C1 = CFrame.new(0, 0.05, 0) * CFrame.Angles(0, 0, 0)
  4563. lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(0, 0, 0)
  4564. rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(0, 0, 0)
  4565. --print("Stopped sneaking...")
  4566. end
  4567. end)
  4568. dead = false
  4569. local humOffset = CFrame.new(0, 0, 0)
  4570. while RS:wait() do
  4571. if neededtopunch == true then
  4572. if punchEnded == 1 then punching = 1 end
  4573. end
  4574. hearts.Size = UDim2.new(0, SnapToGrid((humanoid.Health/humanoid.MaxHealth)*162, 8) + 2, 0, 18)
  4575. if itemOnHand ~= nil then
  4576. hasItemOnHand = 1
  4577. handItem.Transparency = 0
  4578. else
  4579. hasItemOnHand = 0
  4580. handItem.Transparency = 1
  4581. end
  4582. if humanoid.Health < oldHP then
  4583. damageTime = 60
  4584. sound:Play()
  4585. end
  4586. oldHP = humanoid.Health
  4587. if damageTime > 0 and humanoid.Health > 0 then
  4588. for _,p in pairs(char:GetChildren()) do
  4589. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  4590. if p.Name == "DamagePart" then
  4591. p.Transparency = 0.5
  4592. end
  4593. end
  4594. end
  4595. damageTime = damageTime - 2
  4596. if damageTime <= 0 then
  4597. for _,p in pairs(char:GetChildren()) do
  4598. if p.Name ~= "HumanoidRootPart" and p ~= diamondsword and p.ClassName == "Part" then
  4599. if p.Name == "DamagePart" then
  4600. p.Transparency = 1
  4601. end
  4602. end
  4603. end
  4604. end
  4605. end
  4606. function updateItemOnHand()
  4607. for _,d in pairs(handItem:GetChildren()) do
  4608. d:Destroy()
  4609. end
  4610.  
  4611. if oldItemOnHand ~= itemOnHand then
  4612. changedItem = true
  4613. end
  4614. end
  4615. if updateHand == true then
  4616. updateHand = false
  4617. updateItemOnHand()
  4618. if oldItemOnHand ~= itemOnHand then
  4619. changedItem = true
  4620. end
  4621. end
  4622. local pressedWTimes = 0
  4623. local sprintingNum = 0
  4624. local sprinting = false
  4625. Mouse.KeyDown:connect(function(key)
  4626. if sprinting == false then sprintingNum = 0 else sprintingNum = 1 end
  4627. if (key == "w" and sprinting == false and sneaking == 0) then
  4628. if pressedWTimes >= 1 or key == Enum.KeyCode.LeftControl then
  4629. sprinting = true
  4630. humanoid.WalkSpeed = 25
  4631. pressedWTimes = 0
  4632. end
  4633. pressedWTimes = pressedWTimes + 1
  4634. coroutine.resume(coroutine.create(function()
  4635. for i = 1, 9 do
  4636. if sprinting == true then break end
  4637. wait()
  4638. end
  4639. pressedWTimes = 0
  4640. end))
  4641. end
  4642. end)
  4643. Mouse.KeyUp:connect(function(key)
  4644. if sprinting == false then sprintingNum = 0 else sprintingNum = 1 end
  4645. if (key == "w" and sprinting == true and sneaking == 0) then
  4646. sprinting = false
  4647. humanoid.WalkSpeed = 16
  4648. end
  4649. end)
  4650. Mouse.KeyUp:connect(function(key)
  4651. if key == "w" and sprinting == true and sneaking == 0 then
  4652. sprinting = false
  4653. humanoid.WalkSpeed = 16
  4654. pressedWTimes = 0
  4655. end
  4656. end)
  4657. Mouse.KeyDown:connect(function(key)
  4658. if key == "1" or key == "2" or key == "3" or
  4659. key == "4" or key == "5" or key == "6" or
  4660. key == "7" or key == "8" or key == "9" then
  4661. selectedBlock = tonumber(key) - 1
  4662. oldItemOnHand = itemOnHand
  4663. itemOnHand = toolBar[tonumber(key)]
  4664. updateItemOnHand()
  4665. if hasItemOnHand == 0 and itemOnHand then hi = 1 end
  4666. if hasItemOnHand == 1 and itemOnHand == nil then hi = 1 end
  4667. end
  4668. --if (key == "0" or key == "1" or key == "2"
  4669. -- or key == "3" or key == "4" or key == "5"
  4670. -- or key == "6" or key == "7") and hasItemOnHand == 0 then hi = 1 end
  4671. selectLabel.Position = UDim2.new(0.5, -160 + ((selectedBlock)*40), 1, -105)
  4672. end)
  4673. function findNearestTorso(pos)
  4674. local list = game.Workspace:children()
  4675. local torso = nil
  4676. local dist = 3
  4677. local temp = nil
  4678. local human = nil
  4679. local temp2 = nil
  4680. slainbysomeone = nil
  4681. playername = nil
  4682. for x = 1, #list do
  4683. temp2 = list[x]
  4684. if (temp2.className == "Model") and (temp2 ~= char) then
  4685. temp = temp2
  4686. human = temp2:findFirstChild("Humanoid")
  4687. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  4688. if (temp.HumanoidRootPart.Position - pos).magnitude < dist then
  4689. playername = temp.Name
  4690. dist = (temp.HumanoidRootPart.Position - pos).magnitude
  4691. end
  4692. end
  4693. end
  4694. end
  4695. return torso
  4696. end
  4697. --wait(math.random(0,5)/10)
  4698. if humanoid.Health < 1 and dead == false then
  4699. dead = true
  4700. coroutine.resume(coroutine.create(function()
  4701. local target = findNearestTorso(torso.Position)
  4702. if target ~= nil and target:FindFirstChildOfClass("Tool") and target:FindFirstChildOfClass("Tool").Name ~= "Building Tools" and target:FindFirstChildOfClass("Tool").Name ~= "Insert" then
  4703. slainbysomeone = true
  4704. end
  4705. end))
  4706. coroutine.resume(coroutine.create(function()
  4707. local corpseCF = humRootPart.CFrame + Vector3.new(0, -2.925, 0)
  4708. local corpse = Instance.new("Part", workspace)
  4709. corpse.Anchored = true
  4710. corpse.Name = "Dead Corpse"
  4711. target = char
  4712. target.Archivable = true
  4713. playercorpse = target:Clone()
  4714. playercorpse.Parent = corpse
  4715. corpse.Size = Vector3.new(3, 1, 3)
  4716. corpse.CFrame = corpseCF
  4717. corpse.Transparency = 1
  4718. corpse.CustomPhysicalProperties = PhysicalProperties.new(1, 1, 0, 1, 1)
  4719.  
  4720. local dHead = playercorpse.Head
  4721. dHead.CanCollide = false
  4722. --dHead.Material = "Fabric"
  4723.  
  4724. local dTorso = playercorpse.Torso
  4725. dTorso.CanCollide = false
  4726.  
  4727. local dLArm = playercorpse["Left Arm"]
  4728. dLArm.CanCollide = false
  4729.  
  4730. local dRArm = playercorpse["Right Arm"]
  4731. dRArm.CanCollide = false
  4732.  
  4733. local dLLeg = playercorpse["Right Leg"]
  4734. dLLeg.CanCollide = false
  4735.  
  4736. local dRLeg = playercorpse["Right Leg"]
  4737. dRLeg.CanCollide = false
  4738. weldCorpse = Instance.new("Weld",corpse)
  4739. weldCorpse.Part0 = dTorso
  4740. weldCorpse.Part1 = corpse
  4741. weldCorpse.C0 = CFrame.new(0, -1.95 - 0.4, 0)
  4742.  
  4743. -- lazy naming...
  4744.  
  4745. for _,p in pairs(playercorpse:GetChildren()) do
  4746. if p.Name == "DamagePart" then
  4747. p.Transparency = 0.5
  4748. end
  4749. end
  4750.  
  4751. head.Parent = nil
  4752. torso.Parent = nil
  4753. lArm.Parent = nil
  4754. rArm.Parent = nil
  4755. lLeg.Parent = nil
  4756. rLeg.Parent = nil
  4757.  
  4758. weldTo(dTorso, humRootPart)
  4759.  
  4760. for i = 1, 55 do
  4761. corpse.CFrame = corpseCF --*
  4762. --CFrame.Angles(math.rad(-corpse.Orientation.X), 0, math.rad(-corpse.Orientation.Z))
  4763.  
  4764. weldCorpse.C1 = weldCorpse.C1:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, math.rad(90)), 0.075)
  4765. RS:wait()
  4766. end
  4767. for _,p in pairs(corpse:GetChildren()) do
  4768. p:Destroy()
  4769. end
  4770.  
  4771. corpse.Anchored = true
  4772.  
  4773. local smoke = Instance.new("ParticleEmitter", corpse)
  4774. smoke.Size = NumberSequence.new({
  4775. NumberSequenceKeypoint.new(0, 0.6),
  4776. NumberSequenceKeypoint.new(1, 0.6)
  4777. })
  4778. smoke.Texture = "rbxassetid://1494734425"
  4779. smoke.Rate = 100
  4780. smoke.Lifetime = NumberRange.new(0.6, 1.2)
  4781. smoke.Speed = NumberRange.new(2, 5)
  4782. smoke.SpreadAngle = Vector2.new(-30, 30)
  4783.  
  4784. wait(0.07)
  4785.  
  4786. smoke.Enabled = false
  4787.  
  4788. wait(2)
  4789.  
  4790. corpse:Destroy()
  4791. print("You died!")
  4792. end))
  4793. for i,v in pairs(game.Players:GetChildren()) do
  4794. coroutine.resume(coroutine.create(function()
  4795. local sc = Instance.new("ScreenGui",v.PlayerGui)
  4796. sc.Name = "deathmessage"
  4797. local frame = Instance.new("Frame",sc)
  4798. frame.Position = UDim2.new(0,0,0.796,0)
  4799. frame.Size = UDim2.new(0,518,0,112)
  4800. frame.BackgroundTransparency = 1
  4801. local textLabel = Instance.new("TextLabel",frame)
  4802. textLabel.TextSize = 24
  4803. textLabel.Font = "Arcade"
  4804. textLabel.Size = UDim2.new(1,0,1,0)
  4805. textLabel.Position = UDim2.new(0,1,0,1)
  4806. textLabel.BackgroundTransparency = 0.5
  4807. textLabel.BackgroundColor3 = Color3.new(0, 0, 0)
  4808. textLabel.TextColor3 = Color3.new(255, 255, 255)
  4809. if diedtofalldamage == false then
  4810. textLabel.Text = player.Name.." died"
  4811. print(textLabel.Text)
  4812. wait(5)
  4813. textLabel.Visible = false
  4814. else
  4815. textLabel.Text = player.Name.." fell from a high place"
  4816. print(textLabel.Text)
  4817. wait(5)
  4818. textLabel.Visible = false
  4819. end
  4820. if slainbysomeone == false then
  4821. textLabel.Text = player.Name.." died"
  4822. print(textLabel.Text)
  4823. wait(5)
  4824. textLabel.Visible = false
  4825. else
  4826. textLabel.Text = player.Name.." was slain by "..playername
  4827. wait(5)
  4828. textLabel.Visible = false
  4829. end
  4830. end))
  4831. end
  4832. print("You died!")
  4833. end
  4834. local CFNew, CFAng, CFEulAng, Rad = CFrame.new, CFrame.Angles, CFrame.fromEulerAnglesXYZ, math.rad
  4835. --neck.C0 = neck.C0:lerp(CFrame.new(walkAnim/4 - (walkAnim/8), BobbingY/13, 0), 0.25)
  4836.  
  4837. if getMagnitudeXZ(torso.Velocity) > 1 then
  4838. if walkAnim >= 1 then
  4839. increaseWalkAnim = -1
  4840. elseif walkAnim <= -1 then
  4841. increaseWalkAnim = 1
  4842. end
  4843. walkAnim = walkAnim + (increaseWalkAnim/(10+(sneaking*20))) * ((5 + getMagnitudeXZ(torso.Velocity))/20)
  4844. else
  4845. walkAnim = 0
  4846. end
  4847. --lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*45), 0, 0)
  4848. --rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  4849. 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*45) + math.rad(damageTime*1.5) + math.rad(walkAnim*getMagnitudeXZ(torso.Velocity)*5/(1+sneaking)))), 0, 0), 0.15)
  4850. 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*45) + math.rad(-damageTime*1.5) + math.rad(-walkAnim*getMagnitudeXZ(torso.Velocity)*5/(1+sneaking)))), 0, 0), 0.15)
  4851. --
  4852. --rootJoint.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  4853. --print(math.abs(head.Orientation.Y) - math.abs(humRootPart.Orientation.Y))
  4854. --if (head.Orientation.Y * 2) - (head.Orientation.Y + torso.Orientation.Y) > 45 then
  4855. --humRootPart.CFrame = humRootPart.CFrame * CFrame.Angles(0, math.rad(-45 + head.Orientation.Y), 0)
  4856. --print("-45")
  4857. --end
  4858. --if (head.Orientation.Y * 2) - (head.Orientation.Y + torso.Orientation.Y) < -45 then
  4859. --humRootPart.CFrame = humRootPart.CFrame * CFrame.Angles(0, math.rad(45 + head.Orientation.Y), 0)
  4860. --print("45")
  4861. --end
  4862. dododododo = false
  4863. thingyyyy = true
  4864. coroutine.resume(coroutine.create(function()
  4865. while wait(0.000) do
  4866. if dododododo == true then
  4867. if thingyyyy == true then
  4868. thingyyyy = false
  4869. humanoid.HipHeight = humanoid.HipHeight - 0.001
  4870. wait()
  4871. humanoid.HipHeight = humanoid.HipHeight - 0.001
  4872. wait()
  4873. humanoid.HipHeight = humanoid.HipHeight - 0.005
  4874. wait()
  4875. humanoid.HipHeight = humanoid.HipHeight - 0.050
  4876. wait()
  4877. humanoid.HipHeight = humanoid.HipHeight - 0.050
  4878. wait()
  4879. humanoid.HipHeight = humanoid.HipHeight + 0.050
  4880. wait()
  4881. humanoid.HipHeight = humanoid.HipHeight + 0.050
  4882. wait()
  4883. humanoid.HipHeight = humanoid.HipHeight + 0.005
  4884. wait()
  4885. humanoid.HipHeight = humanoid.HipHeight + 0.001
  4886. wait()
  4887. humanoid.HipHeight = humanoid.HipHeight + 0.001
  4888. wait()
  4889. thingyyyy = true
  4890. end
  4891. end
  4892. end
  4893. end))
  4894. --move these arms
  4895. local BobbingY = walkAnim*2
  4896. if BobbingY >= 1 then BobbingY = 1 BobbingY = -BobbingY end
  4897. humanoid.Running:Connect(function()
  4898. dododododo = true
  4899. end)
  4900. humanoid.PlatformStanding:Connect(function()
  4901. dododododo = false
  4902. end)
  4903.  
  4904. local BobbingX = -0.5 + walkAnim
  4905. --neck.C0 = neck.C0:lerp(CFrame.new(walkAnim/4 - (walkAnim/8), BobbingY/13, 0), 0.25)
  4906. humanoid.CameraOffset = Vector3.new(humOffset.X, humOffset.Y, 0)
  4907.  
  4908. rootJoint.C1 = rootJoint.C1:lerp(CFrame.new(0, 0.325, 0) * CFrame.Angles(math.rad(sneaking*45), math.rad(punchRotY), 0), 0.2)
  4909.  
  4910. rootJoint.C1 = rootJoint.C1:lerp(CFrame.new(0, 0.325, 0) * CFrame.Angles(math.rad(sneaking*45), math.rad(punchRotY), 0), 0.2)
  4911.  
  4912. 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)
  4913. 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)
  4914.  
  4915. if Mouse.Target and Mouse.Target ~= camPart and getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  4916. selectBox.Adornee = Mouse.Target
  4917. else
  4918. selectBox.Adornee = nil
  4919. end
  4920.  
  4921. if punching == 1 and punchEnded == 1 then
  4922. punching = 0
  4923. --print("steve uses punch!!")
  4924. local coPunch = coroutine.wrap(function()
  4925. punchEnded = 0
  4926. punchSpeed = 1
  4927. punchRotX = -60
  4928. punchRotY = -8
  4929. punchRotZ = -35
  4930. wait(0.075)
  4931. punchSpeed = 1
  4932. punchRotX = -75
  4933. punchRotY = 8
  4934. punchRotZ = 40
  4935. wait(0.075)
  4936. punchSpeed = 1
  4937. punchRotX = -20
  4938. punchRotZ = 40
  4939. wait(0.075)
  4940. punchSpeed = 3.5
  4941. punchRotX = 0
  4942. punchRotY = 0
  4943. punchRotZ = 0
  4944. punchEnded = 1
  4945. wait(0.06)
  4946. punchSpeed = 0
  4947. end)
  4948. coPunch()
  4949. end
  4950.  
  4951. if ticks > 20 then
  4952. ticks = 0
  4953. if times == 0 then
  4954. times = times + 1
  4955. idleAnimRotX = -1
  4956. idleAnimRotZ = 0
  4957. elseif times == 1 then
  4958. times = times + 1
  4959. idleAnimRotX = -0.75
  4960. idleAnimRotZ = -0.75
  4961. elseif times == 2 then
  4962. times = times + 1
  4963. idleAnimRotX = 0
  4964. idleAnimRotZ = -1
  4965. elseif times == 3 then
  4966. times = times + 1
  4967. idleAnimRotX = 0.75
  4968. idleAnimRotZ = -0.75
  4969. --idleAnimRotX = 0.75
  4970. --idleAnimRotZ = -0
  4971. elseif times == 4 then
  4972. times = times + 1
  4973. idleAnimRotX = 1
  4974. idleAnimRotZ = 0
  4975. --idleAnimRotX = 1
  4976. --idleAnimRotZ = 0
  4977. elseif times == 5 then
  4978. times = times + 1
  4979. idleAnimRotX = 0.75
  4980. idleAnimRotZ = 0.75
  4981. elseif times == 6 then
  4982. times = times + 1
  4983. idleAnimRotX = 0
  4984. idleAnimRotZ = 1
  4985. elseif times == 7 then
  4986. times = 0
  4987. idleAnimRotX = -0.75
  4988. idleAnimRotZ = 0.75
  4989. end
  4990. end
  4991.  
  4992. if hi == 1 then hi = 0 end
  4993. end
  4994.  
  4995. end
  4996.  
  4997. end
Add Comment
Please, Sign In to add comment