sIendytubble

steve script for void

Jun 17th, 2020
574
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 90.14 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. -- NOTE (READ!!): This script doesn't work on voidacity's script builder
  7. -- since it crashes your game, but it's usable on other
  8. -- script builders like fancy dev's or nexure's.
  9. -- (it just doesn't work on voidacity only)
  10.  
  11. --[[
  12.  
  13.  
  14.  
  15. ▓▒▒▓▓ ░▓▒▒██▒▒▓█▒▒▓▓ █▒▒▓█▒▒▒▒▒▒▒█▓▒▒▒▒▒▒▒█▒▓▒▒▒▒▒▓█▒▒▒▒▒▒▒█▓▒▒▒▓▒▒▓█▒▒▒▒▒▓▒▓░
  16. ▓ ░█▒ ▓░ ▓▓ ░█ ░█░▒ ▒▒ █░ █ ░ ▒▓ ▓▒ █ ░░
  17. ░░ ░ ▒██░░░ █░ ▓▓ ░░█░ ▓▒ ▒█████░ ▓█████░░ ▓▓ ░█ ▒█░█▓ ▒▓ ░███████▓ ██░
  18. ▓ ▓█▓ ▒▒█ █▒ ░█ ▓▒ ▒█████░ ▓█████░░ ▓▓ ░█ ▒█▓░ ░▓ ▓███████ █▓
  19. ▓ ░░ ▒█ █▒ ░ █░ ░░░░█░ ▓█████░ ▒██░ ▒██▒ ░█ ░ ░███ ▒░
  20. ▒░ ░░ ▓▓ █░ ▓▒ █░ ░░ ░█░ ▓█████░ █░ ░░ ░ █░ ░ ███░ ░▒
  21. ▒░ ▓▓ ▒▓ █░ ▒█ █▒ ░ █ ▓█████░ ▓ █░ ▒▓ █▒ ░ █▒ ▒█▓█████▓ ░▒
  22. ▒░▒░█▒▒█▓ █░ ▓█ ██░ ░ █░ ▓█████░ ▓█████░ ▒█ ░ █▒ ▒█ ░ █▒ ░███▓███▓░ ▒
  23. ░▒░ ▒█▓ ▒▒ ▒█░ ▓▓ ░██ ░▓ ▒ ░ █░ █░ ▒█ ▓▒ ░█ ▒▓ ███ ▓███░ ▒░
  24. ▒░ ░▓██▒░░ ▓▓ █▒ ▒██ ▓▓ ░ ░ ░█░ ░ █░ ▒█ ▓▓ █░ ▒█ █▓░ ░███▒ ░▒
  25. ▒▒ ▒███░▒ ░█ █▓ ░██░ ▒█ ░ █░ ░ █░ ▒█ █▒ ░█ ▓▓ ░█ ░██▓▒ ▓░
  26. ▒▒ ▒██▓▓▒ ▒▓ █░ ▓█▓ █░ ▒█░ █░ ▓▓ ░█░ ▓▒ ░█▒ ▓ ▓█▒░ ▒▒
  27. ▒▒░ █▓ ▓▒░▒█▒░░▓█░░▒█▒▒░░▓▓░▒▒▒░░▒█▒░░░░░░░█▒░▒█▓░░▓█▒░▒█░░░█▓░░▓▒ ▓█░░▒▒
  28. ░▒▒▒░ ▒░░▒▒░░░░░░░░ ▒░░░▒▒▒▒▒▒▒▒░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒░▒▒▒░░░░ ░░░▒░
  29. ASCII Art Generators are cool :)
  30.  
  31.  
  32.  
  33. ]]
  34.  
  35. -- Scroll down for changelog...
  36.  
  37. -- ORIGINAL CREATOR: Depr1
  38.  
  39. -- If this script isn't on pastebin or the user who uploaded this isn't called "Delros12"
  40. -- (and yes my pastebin account is Delros12) or the link is not https://pastebin.com/2NNDTLjL
  41. -- then this is not the original link of this script.
  42.  
  43. -- The original link of the script gets edited constantly for updates, if you use the original
  44. -- link you will be able to enjoy the most recent updates of this script without changing to
  45. -- another link which contains updated script.
  46.  
  47. -- Controls: Q to sneak, use the keypad numbers 1-9 to change blocks,
  48. -- choose a empty slot if you want to remove a block, E to open creative
  49. -- inventory, right-click to destroy a block in your toolbar in creative
  50. -- inventory, R to make camera face your character's front or back.
  51.  
  52. -- You will become steve when you use this script, if you die after
  53. -- using this script, keep trying to use it or wait 60 seconds
  54. -- (it doesn't work at first but eventually it will)
  55.  
  56. -- Enjoy! :)
  57.  
  58. local updateHand = false
  59. local Changelog = [[
  60.  
  61. Redstone coming soon. (not... sorry)
  62. Note (Read!): It will be a very long while till this script gets
  63. updated again, i stopped updating this since im focusing more on other things
  64. like C++ programming and game development, i'm not really that active much
  65. in roblox (and if im off im probably programming), so yeah, maybe in a
  66. million years i'll come back to update the script again (:P).
  67. 09/03/2018:
  68. + Added the heart bar.
  69. + Added death animation.
  70. * Your camera now shakes like in minecraft when hurt.
  71. * Toolbar Selection GUI now is accurate.
  72.  
  73. 02/03/2018:
  74. * Fixed a bug with the textures.
  75.  
  76. 01/03/2018:
  77. + Added a global grid.
  78. + Added something that i'm not sure how to describe.
  79. * Punching Animation in first person is now more accurate.
  80.  
  81. 17/02/2018:
  82. + You can't break your neck anymore (360 head you know)
  83. + Added this changelog
  84. - Removed the name tag, since it causes it to get banned on
  85. some servers for some reason (really voidacity?).
  86. * Walking animation is now more accurate
  87.  
  88. Note: It's been a while since i don't update the script, but i'll
  89. get back to updating it.
  90.  
  91. 05/02/2018:
  92. + Added gravity to sand and gravel (WARNING: Can be laggy!)
  93.  
  94. 04/02/2018:
  95. + Added creative inventory
  96. + Added 31 blocks (that's a lot, but not near minecraft's level)
  97. + Added sprinting (i'll add footsteps and particles later)
  98. - Removed Herobrine
  99. * Fixed a bug where the hand dissapears if u look down while sneaking
  100. * Fixed? (not sure) a bug where if u ran the script you would die
  101.  
  102. 01/02/2018:
  103. + Added the hand that appears on minecraft when ur first person
  104. + Added a walking animation to the hand
  105. + Punching animation added to the hand
  106. + Camera bobbing
  107. + Sneaking now lowers your camera just like in minecraft
  108. + Blocks now have sounds (i chose the ones that are the closest to minecraft sounds)
  109. + When a block is broken, particles will fall from it
  110. ]]
  111.  
  112. workspace:WaitForChild("Camera"):ClearAllChildren()
  113. local RS = game:GetService("RunService").RenderStepped
  114. local targetName = game.Players.LocalPlayer.Name
  115. local Player = owner
  116.  
  117. local creativeInventory = {
  118. {
  119. name = "Dirt",
  120. size = Vector3.new(2.6, 2.6, 2.6),
  121. transparency = 0;
  122. frontTex = "rbxassetid://152569532",
  123. backTex = "rbxassetid://152569532",
  124. topTex = "rbxassetid://152569532",
  125. bottomTex = "rbxassetid://152569532",
  126. leftTex = "rbxassetid://152569532",
  127. rightTex = "rbxassetid://152569532",
  128. displayTex = "",
  129. sound = "rbxassetid://1102186681",
  130. soundVol = 1.25,
  131. hasGravity = false,
  132. objectType = "Block"
  133. },
  134. {
  135. name = "Grass",
  136. size = Vector3.new(2.6, 2.6, 2.6),
  137. transparency = 0;
  138. frontTex = "rbxassetid://96430337",
  139. backTex = "rbxassetid://96430337",
  140. topTex = "rbxassetid://96430265",
  141. bottomTex = "rbxassetid://179655033",
  142. leftTex = "rbxassetid://96430337",
  143. rightTex = "rbxassetid://96430337",
  144. displayTex = "",
  145. sound = "rbxassetid://1102186681",
  146. soundVol = 1.25,
  147. hasGravity = false,
  148. objectType = "Block"
  149. },
  150. {
  151. name = "Sand",
  152. size = Vector3.new(2.6, 2.6, 2.6),
  153. transparency = 0;
  154. frontTex = "rbxassetid://347007448",
  155. backTex = "rbxassetid://347007448",
  156. topTex = "rbxassetid://347007448",
  157. bottomTex = "rbxassetid://347007448",
  158. leftTex = "rbxassetid://347007448",
  159. rightTex = "rbxassetid://347007448",
  160. displayTex = "",
  161. sound = "rbxassetid://1102186681",
  162. soundVol = 1.25,
  163. hasGravity = true,
  164. objectType = "Block"
  165. },
  166. {
  167. name = "Gravel",
  168. size = Vector3.new(2.6, 2.6, 2.6),
  169. transparency = 0;
  170. frontTex = "rbxassetid://151701568",
  171. backTex = "rbxassetid://151701568",
  172. topTex = "rbxassetid://151701568",
  173. bottomTex = "rbxassetid://151701568",
  174. leftTex = "rbxassetid://151701568",
  175. rightTex = "rbxassetid://151701568",
  176. displayTex = "",
  177. sound = "rbxassetid://1102186681",
  178. soundVol = 1.25,
  179. hasGravity = true,
  180. objectType = "Block"
  181. },
  182. {
  183. name = "Stone",
  184. size = Vector3.new(2.6, 2.6, 2.6),
  185. transparency = 0;
  186. frontTex = "rbxassetid://75880927",
  187. backTex = "rbxassetid://75880927",
  188. topTex = "rbxassetid://75880927",
  189. bottomTex = "rbxassetid://75880927",
  190. leftTex = "rbxassetid://75880927",
  191. rightTex = "rbxassetid://75880927",
  192. displayTex = "",
  193. sound = "rbxassetid://1016978163",
  194. soundVol = 2,
  195. hasGravity = false,
  196. objectType = "Block"
  197. },
  198. {
  199. name = "Diamond Ore",
  200. size = Vector3.new(2.6, 2.6, 2.6),
  201. transparency = 0;
  202. frontTex = "rbxassetid://57928490",
  203. backTex = "rbxassetid://57928490",
  204. topTex = "rbxassetid://57928490",
  205. bottomTex = "rbxassetid://57928490",
  206. leftTex = "rbxassetid://57928490",
  207. rightTex = "rbxassetid://57928490",
  208. displayTex = "",
  209. sound = "rbxassetid://1016978163",
  210. soundVol = 2,
  211. hasGravity = false,
  212. objectType = "Block"
  213. },
  214. {
  215. name = "Diamond Block",
  216. size = Vector3.new(2.6, 2.6, 2.6),
  217. transparency = 0;
  218. frontTex = "rbxassetid://56749955",
  219. backTex = "rbxassetid://56749955",
  220. topTex = "rbxassetid://56749955",
  221. bottomTex = "rbxassetid://56749955",
  222. leftTex = "rbxassetid://56749955",
  223. rightTex = "rbxassetid://56749955",
  224. displayTex = "",
  225. sound = "rbxassetid://1016978163",
  226. soundVol = 2,
  227. hasGravity = false,
  228. objectType = "Block"
  229. },
  230. {
  231. name = "Emerald Block",
  232. size = Vector3.new(2.6, 2.6, 2.6),
  233. transparency = 0;
  234. frontTex = "rbxassetid://152410853",
  235. backTex = "rbxassetid://152410853",
  236. topTex = "rbxassetid://152410853",
  237. bottomTex = "rbxassetid://152410853",
  238. leftTex = "rbxassetid://152410853",
  239. rightTex = "rbxassetid://152410853",
  240. displayTex = "",
  241. sound = "rbxassetid://1016978163",
  242. soundVol = 2,
  243. hasGravity = false,
  244. objectType = "Block"
  245. },
  246. {
  247. name = "Emerald Ore",
  248. size = Vector3.new(2.6, 2.6, 2.6),
  249. transparency = 0;
  250. frontTex = "rbxassetid://152410868",
  251. backTex = "rbxassetid://152410868",
  252. topTex = "rbxassetid://152410868",
  253. bottomTex = "rbxassetid://152410868",
  254. leftTex = "rbxassetid://152410868",
  255. rightTex = "rbxassetid://152410868",
  256. displayTex = "",
  257. sound = "rbxassetid://1016978163",
  258. soundVol = 2,
  259. hasGravity = false,
  260. objectType = "Block"
  261. },
  262. {
  263. name = "Obsidian",
  264. size = Vector3.new(2.6, 2.6, 2.6),
  265. transparency = 0;
  266. frontTex = "rbxassetid://112560322",
  267. backTex = "rbxassetid://112560322",
  268. topTex = "rbxassetid://112560322",
  269. bottomTex = "rbxassetid://112560322",
  270. leftTex = "rbxassetid://112560322",
  271. rightTex = "rbxassetid://112560322",
  272. displayTex = "",
  273. sound = "rbxassetid://1016978163",
  274. soundVol = 2,
  275. hasGravity = false,
  276. objectType = "Block"
  277. },
  278. {
  279. name = "Gold Block",
  280. size = Vector3.new(2.6, 2.6, 2.6),
  281. transparency = 0;
  282. frontTex = "rbxassetid://152572128",
  283. backTex = "rbxassetid://152572128",
  284. topTex = "rbxassetid://152572128",
  285. bottomTex = "rbxassetid://152572128",
  286. leftTex = "rbxassetid://152572128",
  287. rightTex = "rbxassetid://152572128",
  288. displayTex = "",
  289. sound = "rbxassetid://1016978163",
  290. soundVol = 2,
  291. hasGravity = false,
  292. objectType = "Block"
  293. },
  294. {
  295. name = "Gold Ore",
  296. size = Vector3.new(2.6, 2.6, 2.6),
  297. transparency = 0;
  298. frontTex = "rbxassetid://152572121",
  299. backTex = "rbxassetid://152572121",
  300. topTex = "rbxassetid://152572121",
  301. bottomTex = "rbxassetid://152572121",
  302. leftTex = "rbxassetid://152572121",
  303. rightTex = "rbxassetid://152572121",
  304. displayTex = "",
  305. sound = "rbxassetid://1016978163",
  306. soundVol = 2,
  307. hasGravity = false,
  308. objectType = "Block"
  309. },
  310. {
  311. name = "Iron Block",
  312. size = Vector3.new(2.6, 2.6, 2.6),
  313. transparency = 0;
  314. frontTex = "rbxassetid://152572134",
  315. backTex = "rbxassetid://152572134",
  316. topTex = "rbxassetid://152572134",
  317. bottomTex = "rbxassetid://152572134",
  318. leftTex = "rbxassetid://152572134",
  319. rightTex = "rbxassetid://152572134",
  320. displayTex = "",
  321. sound = "rbxassetid://1016978163",
  322. soundVol = 2,
  323. hasGravity = false,
  324. objectType = "Block"
  325. },
  326. {
  327. name = "Iron Ore",
  328. size = Vector3.new(2.6, 2.6, 2.6),
  329. transparency = 0;
  330. frontTex = "rbxassetid://132879562",
  331. backTex = "rbxassetid://132879562",
  332. topTex = "rbxassetid://132879562",
  333. bottomTex = "rbxassetid://132879562",
  334. leftTex = "rbxassetid://132879562",
  335. rightTex = "rbxassetid://132879562",
  336. displayTex = "",
  337. sound = "rbxassetid://1016978163",
  338. soundVol = 2,
  339. hasGravity = false,
  340. objectType = "Block"
  341. },
  342. {
  343. name = "Redstone Block",
  344. size = Vector3.new(2.6, 2.6, 2.6),
  345. transparency = 0;
  346. frontTex = "rbxassetid://136260219",
  347. backTex = "rbxassetid://136260219",
  348. topTex = "rbxassetid://136260219",
  349. bottomTex = "rbxassetid://136260219",
  350. leftTex = "rbxassetid://136260219",
  351. rightTex = "rbxassetid://136260219",
  352. sound = "rbxassetid://1016978163",
  353. soundVol = 2,
  354. hasGravity = false,
  355. objectType = "Block"
  356. },
  357. {
  358. name = "Redstone Ore",
  359. size = Vector3.new(2.6, 2.6, 2.6),
  360. transparency = 0;
  361. frontTex = "rbxassetid://152572209",
  362. backTex = "rbxassetid://152572209",
  363. topTex = "rbxassetid://152572209",
  364. bottomTex = "rbxassetid://152572209",
  365. leftTex = "rbxassetid://152572209",
  366. rightTex = "rbxassetid://152572209",
  367. displayTex = "",
  368. sound = "rbxassetid://1016978163",
  369. soundVol = 2,
  370. hasGravity = false,
  371. objectType = "Block"
  372. },
  373. {
  374. name = "Coal Block",
  375. size = Vector3.new(2.6, 2.6, 2.6),
  376. transparency = 0;
  377. frontTex = "rbxassetid://152527418",
  378. backTex = "rbxassetid://152527418",
  379. topTex = "rbxassetid://152527418",
  380. bottomTex = "rbxassetid://152527418",
  381. leftTex = "rbxassetid://152527418",
  382. rightTex = "rbxassetid://152527418",
  383. displayTex = "",
  384. sound = "rbxassetid://1016978163",
  385. soundVol = 2,
  386. hasGravity = false,
  387. objectType = "Block"
  388. },
  389. {
  390. name = "Coal Ore",
  391. size = Vector3.new(2.6, 2.6, 2.6),
  392. transparency = 0;
  393. frontTex = "rbxassetid://152572101",
  394. backTex = "rbxassetid://152572101",
  395. topTex = "rbxassetid://152572101",
  396. bottomTex = "rbxassetid://152572101",
  397. leftTex = "rbxassetid://152572101",
  398. rightTex = "rbxassetid://152572101",
  399. displayTex = "",
  400. sound = "rbxassetid://1016978163",
  401. soundVol = 2,
  402. hasGravity = false,
  403. objectType = "Block"
  404. },
  405. {
  406. name = "Bedrock",
  407. size = Vector3.new(2.6, 2.6, 2.6),
  408. transparency = 0;
  409. frontTex = "rbxassetid://75881126",
  410. backTex = "rbxassetid://75881126",
  411. topTex = "rbxassetid://75881126",
  412. bottomTex = "rbxassetid://75881126",
  413. leftTex = "rbxassetid://75881126",
  414. rightTex = "rbxassetid://75881126",
  415. displayTex = "",
  416. sound = "rbxassetid://1016978163",
  417. soundVol = 2,
  418. hasGravity = false,
  419. objectType = "Block"
  420. },
  421. {
  422. name = "Cobblestone",
  423. size = Vector3.new(2.6, 2.6, 2.6),
  424. transparency = 0;
  425. frontTex = "rbxassetid://152572105",
  426. backTex = "rbxassetid://152572105",
  427. topTex = "rbxassetid://152572105",
  428. bottomTex = "rbxassetid://152572105",
  429. leftTex = "rbxassetid://152572105",
  430. rightTex = "rbxassetid://152572105",
  431. displayTex = "",
  432. sound = "rbxassetid://1016978163",
  433. soundVol = 2,
  434. hasGravity = false,
  435. objectType = "Block"
  436. },
  437. {
  438. name = "Mossy Stone Brick",
  439. size = Vector3.new(2.6, 2.6, 2.6),
  440. transparency = 0;
  441. frontTex = "rbxassetid://61826751",
  442. backTex = "rbxassetid://61826751",
  443. topTex = "rbxassetid://61826751",
  444. bottomTex = "rbxassetid://61826751",
  445. leftTex = "rbxassetid://61826751",
  446. rightTex = "rbxassetid://61826751",
  447. displayTex = "",
  448. sound = "rbxassetid://1016978163",
  449. soundVol = 2,
  450. hasGravity = false,
  451. objectType = "Block"
  452. },
  453. {
  454. name = "Cracked Stone Brick",
  455. size = Vector3.new(2.6, 2.6, 2.6),
  456. transparency = 0;
  457. frontTex = "rbxassetid://151802087",
  458. backTex = "rbxassetid://151802087",
  459. topTex = "rbxassetid://151802087",
  460. bottomTex = "rbxassetid://151802087",
  461. leftTex = "rbxassetid://151802087",
  462. rightTex = "rbxassetid://151802087",
  463. displayTex = "",
  464. sound = "rbxassetid://1016978163",
  465. soundVol = 2,
  466. hasGravity = false,
  467. objectType = "Block"
  468. },
  469. {
  470. name = "Chiseled Stone Brick",
  471. size = Vector3.new(2.6, 2.6, 2.6),
  472. transparency = 0;
  473. frontTex = "rbxassetid://151802074",
  474. backTex = "rbxassetid://151802074",
  475. topTex = "rbxassetid://151802074",
  476. bottomTex = "rbxassetid://151802074",
  477. leftTex = "rbxassetid://151802074",
  478. rightTex = "rbxassetid://151802074",
  479. displayTex = "",
  480. sound = "rbxassetid://1016978163",
  481. soundVol = 2,
  482. hasGravity = false,
  483. objectType = "Block"
  484. },
  485. {
  486. name = "Stone Brick",
  487. size = Vector3.new(2.6, 2.6, 2.6),
  488. transparency = 0;
  489. frontTex = "rbxassetid://61826773",
  490. backTex = "rbxassetid://61826773",
  491. topTex = "rbxassetid://61826773",
  492. bottomTex = "rbxassetid://61826773",
  493. leftTex = "rbxassetid://61826773",
  494. rightTex = "rbxassetid://61826773",
  495. displayTex = "",
  496. sound = "rbxassetid://1016978163",
  497. soundVol = 2,
  498. hasGravity = false,
  499. objectType = "Block"
  500. },
  501. {
  502. name = "Nether Brick",
  503. size = Vector3.new(2.6, 2.6, 2.6),
  504. transparency = 0;
  505. frontTex = "rbxassetid://151802104",
  506. backTex = "rbxassetid://151802104",
  507. topTex = "rbxassetid://151802104",
  508. bottomTex = "rbxassetid://151802104",
  509. leftTex = "rbxassetid://151802104",
  510. rightTex = "rbxassetid://151802104",
  511. displayTex = "",
  512. sound = "rbxassetid://1016978163",
  513. soundVol = 2,
  514. hasGravity = false,
  515. objectType = "Block"
  516. },
  517. {
  518. name = "Granite",
  519. size = Vector3.new(2.6, 2.6, 2.6),
  520. transparency = 0;
  521. frontTex = "rbxassetid://151776467",
  522. backTex = "rbxassetid://151776467",
  523. topTex = "rbxassetid://151776467",
  524. bottomTex = "rbxassetid://151776467",
  525. leftTex = "rbxassetid://151776467",
  526. rightTex = "rbxassetid://151776467",
  527. displayTex = "",
  528. sound = "rbxassetid://1016978163",
  529. soundVol = 2,
  530. hasGravity = false,
  531. objectType = "Block"
  532. },
  533. {
  534. name = "Diorite",
  535. size = Vector3.new(2.6, 2.6, 2.6),
  536. transparency = 0;
  537. frontTex = "rbxassetid://151776452",
  538. backTex = "rbxassetid://151776452",
  539. topTex = "rbxassetid://151776452",
  540. bottomTex = "rbxassetid://151776452",
  541. leftTex = "rbxassetid://151776452",
  542. rightTex = "rbxassetid://151776452",
  543. sound = "rbxassetid://1016978163",
  544. soundVol = 2,
  545. hasGravity = false,
  546. objectType = "Block"
  547. },
  548. {
  549. name = "Andesite",
  550. size = Vector3.new(2.6, 2.6, 2.6),
  551. transparency = 0;
  552. frontTex = "rbxassetid://151776422",
  553. backTex = "rbxassetid://151776422",
  554. topTex = "rbxassetid://151776422",
  555. bottomTex = "rbxassetid://151776422",
  556. leftTex = "rbxassetid://151776422",
  557. rightTex = "rbxassetid://151776422",
  558. displayTex = "",
  559. sound = "rbxassetid://1016978163",
  560. soundVol = 2,
  561. hasGravity = false,
  562. objectType = "Block"
  563. },
  564. {
  565. name = "Polished Granite",
  566. size = Vector3.new(2.6, 2.6, 2.6),
  567. transparency = 0;
  568. frontTex = "rbxassetid://151776506",
  569. backTex = "rbxassetid://151776506",
  570. topTex = "rbxassetid://151776506",
  571. bottomTex = "rbxassetid://151776506",
  572. leftTex = "rbxassetid://151776506",
  573. rightTex = "rbxassetid://151776506",
  574. displayTex = "",
  575. sound = "rbxassetid://1016978163",
  576. soundVol = 2,
  577. hasGravity = false,
  578. objectType = "Block"
  579. },
  580. {
  581. name = "Polished Diorite",
  582. size = Vector3.new(2.6, 2.6, 2.6),
  583. transparency = 0;
  584. frontTex = "rbxassetid://151776533",
  585. backTex = "rbxassetid://151776533",
  586. topTex = "rbxassetid://151776533",
  587. bottomTex = "rbxassetid://151776533",
  588. leftTex = "rbxassetid://151776533",
  589. rightTex = "rbxassetid://151776533",
  590. displayTex = "",
  591. sound = "rbxassetid://1016978163",
  592. soundVol = 2,
  593. hasGravity = false,
  594. objectType = "Block"
  595. },
  596. {
  597. name = "Polished Andesite",
  598. size = Vector3.new(2.6, 2.6, 2.6),
  599. transparency = 0;
  600. frontTex = "rbxassetid://151776506",
  601. backTex = "rbxassetid://151776506",
  602. topTex = "rbxassetid://151776506",
  603. bottomTex = "rbxassetid://151776506",
  604. leftTex = "rbxassetid://151776506",
  605. rightTex = "rbxassetid://151776506",
  606. displayTex = "",
  607. sound = "rbxassetid://1016978163",
  608. soundVol = 2,
  609. hasGravity = false,
  610. objectType = "Block"
  611. },
  612. {
  613. name = "Brick Block",
  614. size = Vector3.new(2.6, 2.6, 2.6),
  615. transparency = 0;
  616. frontTex = "rbxassetid://59389191",
  617. backTex = "rbxassetid://59389191",
  618. topTex = "rbxassetid://59389191",
  619. bottomTex = "rbxassetid://59389191",
  620. leftTex = "rbxassetid://59389191",
  621. rightTex = "rbxassetid://59389191",
  622. displayTex = "",
  623. sound = "rbxassetid://1016978163",
  624. soundVol = 2,
  625. hasGravity = false,
  626. objectType = "Block"
  627. },
  628. {
  629. name = "Packed Ice",
  630. size = Vector3.new(2.6, 2.6, 2.6),
  631. transparency = 0;
  632. frontTex = "rbxassetid://152528023",
  633. backTex = "rbxassetid://152528023",
  634. topTex = "rbxassetid://152528023",
  635. bottomTex = "rbxassetid://152528023",
  636. leftTex = "rbxassetid://152528023",
  637. rightTex = "rbxassetid://152528023",
  638. displayTex = "",
  639. sound = "rbxassetid://1016978163",
  640. soundVol = 2,
  641. hasGravity = false,
  642. objectType = "Block"
  643. },
  644. {
  645. name = "Ice Block",
  646. size = Vector3.new(2.6, 2.6, 2.6),
  647. transparency = 1;
  648. frontTex = "rbxassetid://118555586",
  649. backTex = "rbxassetid://118555586",
  650. topTex = "rbxassetid://118555586",
  651. bottomTex = "rbxassetid://118555586",
  652. leftTex = "rbxassetid://118555586",
  653. rightTex = "rbxassetid://118555586",
  654. displayTex = "",
  655. sound = "rbxassetid://1016978163",
  656. soundVol = 2,
  657. hasGravity = false,
  658. objectType = "Block"
  659. },
  660. {
  661. name = "Netherrack",
  662. size = Vector3.new(2.6, 2.6, 2.6),
  663. transparency = 0;
  664. frontTex = "rbxassetid://151802119",
  665. backTex = "rbxassetid://151802119",
  666. topTex = "rbxassetid://151802119",
  667. bottomTex = "rbxassetid://151802119",
  668. leftTex = "rbxassetid://151802119",
  669. rightTex = "rbxassetid://151802119",
  670. displayTex = "",
  671. sound = "rbxassetid://1016978163",
  672. soundVol = 2,
  673. hasGravity = false,
  674. objectType = "Block"
  675. },
  676. {
  677. name = "End Stone",
  678. size = Vector3.new(2.6, 2.6, 2.6),
  679. transparency = 0;
  680. frontTex = "rbxassetid://151802091",
  681. backTex = "rbxassetid://151802091",
  682. topTex = "rbxassetid://151802091",
  683. bottomTex = "rbxassetid://151802091",
  684. leftTex = "rbxassetid://151802091",
  685. rightTex = "rbxassetid://151802091",
  686. displayTex = "",
  687. sound = "rbxassetid://1016978163",
  688. soundVol = 2,
  689. hasGravity = false,
  690. objectType = "Block"
  691. },
  692. {
  693. name = "Glass Block",
  694. size = Vector3.new(2.6, 2.6, 2.6),
  695. transparency = 1;
  696. frontTex = "rbxassetid://152239003",
  697. backTex = "rbxassetid://152239003",
  698. topTex = "rbxassetid://152239003",
  699. bottomTex = "rbxassetid://152239003",
  700. leftTex = "rbxassetid://152239003",
  701. rightTex = "rbxassetid://152239003",
  702. displayTex = "",
  703. sound = "rbxassetid://1016978163",
  704. soundVol = 2,
  705. hasGravity = false,
  706. objectType = "Block"
  707. },
  708. {
  709. name = "Glowstone",
  710. size = Vector3.new(2.6, 2.6, 2.6),
  711. transparency = 0;
  712. frontTex = "rbxassetid://54790811",
  713. backTex = "rbxassetid://54790811",
  714. topTex = "rbxassetid://54790811",
  715. bottomTex = "rbxassetid://54790811",
  716. leftTex = "rbxassetid://54790811",
  717. rightTex = "rbxassetid://54790811",
  718. displayTex = "",
  719. sound = "rbxassetid://1016978163",
  720. soundVol = 2,
  721. hasGravity = false,
  722. objectType = "Block"
  723. },
  724. {
  725. name = "Bookshelf",
  726. size = Vector3.new(2.6, 2.6, 2.6),
  727. transparency = 0;
  728. frontTex = "rbxassetid://118554092",
  729. backTex = "rbxassetid://118554092",
  730. topTex = "rbxassetid://346201871",
  731. bottomTex = "rbxassetid://346201871",
  732. leftTex = "rbxassetid://118554092",
  733. rightTex = "rbxassetid://118554092",
  734. displayTex = "",
  735. sound = "rbxassetid://507863457",
  736. soundVol = 2,
  737. hasGravity = false,
  738. objectType = "Block"
  739. },
  740. {
  741. name = "Oak Wood Planks",
  742. size = Vector3.new(2.6, 2.6, 2.6),
  743. transparency = 0;
  744. frontTex = "rbxassetid://346201871",
  745. backTex = "rbxassetid://346201871",
  746. topTex = "rbxassetid://346201871",
  747. bottomTex = "rbxassetid://346201871",
  748. leftTex = "rbxassetid://346201871",
  749. rightTex = "rbxassetid://346201871",
  750. displayTex = "",
  751. sound = "rbxassetid://507863457",
  752. soundVol = 2,
  753. hasGravity = false,
  754. objectType = "Block"
  755. },
  756. {
  757. name = "Oak Log",
  758. size = Vector3.new(2.6, 2.6, 2.6),
  759. transparency = 0;
  760. frontTex = "rbxassetid://71445924",
  761. backTex = "rbxassetid://71445924",
  762. topTex = "rbxassetid://152538557",
  763. bottomTex = "rbxassetid://152538557",
  764. leftTex = "rbxassetid://71445924",
  765. rightTex = "rbxassetid://71445924",
  766. displayTex = "",
  767. sound = "rbxassetid://507863457",
  768. soundVol = 2,
  769. hasGravity = false,
  770. objectType = "Block"
  771. },
  772. {
  773. name = "Oak Leaves",
  774. size = Vector3.new(2.6, 2.6, 2.6),
  775. transparency = 1;
  776. frontTex = "rbxassetid://151708391",
  777. backTex = "rbxassetid://151708391",
  778. topTex = "rbxassetid://151708391",
  779. bottomTex = "rbxassetid://151708391",
  780. leftTex = "rbxassetid://151708391",
  781. rightTex = "rbxassetid://151708391",
  782. displayTex = "",
  783. sound = "rbxassetid://507863457",
  784. -- couldn't find a leaves sound for this one, sorry lol
  785. soundVol = 2,
  786. hasGravity = false,
  787. objectType = "Block"
  788. }
  789. }
  790. local toolBar = {
  791. {
  792. name = "Dirt Block",
  793. size = Vector3.new(2.6, 2.6, 2.6),
  794. transparency = 0;
  795. frontTex = "rbxassetid://152569532",
  796. backTex = "rbxassetid://152569532",
  797. topTex = "rbxassetid://152569532",
  798. bottomTex = "rbxassetid://152569532",
  799. leftTex = "rbxassetid://152569532",
  800. rightTex = "rbxassetid://152569532",
  801. displayTex = "",
  802. sound = "rbxassetid://1102186681",
  803. soundVol = 1.25,
  804. hasGravity = false,
  805. objectType = "Block"
  806. },
  807. {
  808. name = "Grass Block",
  809. size = Vector3.new(2.6, 2.6, 2.6),
  810. transparency = 0;
  811. frontTex = "rbxassetid://96430337",
  812. backTex = "rbxassetid://96430337",
  813. topTex = "rbxassetid://96430265",
  814. bottomTex = "rbxassetid://179655033",
  815. leftTex = "rbxassetid://96430337",
  816. rightTex = "rbxassetid://96430337",
  817. displayTex = "",
  818. sound = "rbxassetid://1102186681",
  819. soundVol = 1.25,
  820. hasGravity = false,
  821. objectType = "Block"
  822. },
  823. {
  824. name = "Stone",
  825. size = Vector3.new(2.6, 2.6, 2.6),
  826. transparency = 0;
  827. frontTex = "rbxassetid://75880927",
  828. backTex = "rbxassetid://75880927",
  829. topTex = "rbxassetid://75880927",
  830. bottomTex = "rbxassetid://75880927",
  831. leftTex = "rbxassetid://75880927",
  832. rightTex = "rbxassetid://75880927",
  833. displayTex = "",
  834. sound = "rbxassetid://1016978163",
  835. soundVol = 2,
  836. hasGravity = false,
  837. objectType = "Block"
  838. },
  839. {
  840. name = "Diamond Ore",
  841. size = Vector3.new(2.6, 2.6, 2.6),
  842. transparency = 0;
  843. frontTex = "rbxassetid://57928490",
  844. backTex = "rbxassetid://57928490",
  845. topTex = "rbxassetid://57928490",
  846. bottomTex = "rbxassetid://57928490",
  847. leftTex = "rbxassetid://57928490",
  848. rightTex = "rbxassetid://57928490",
  849. displayTex = "",
  850. sound = "rbxassetid://1016978163",
  851. soundVol = 2,
  852. hasGravity = false,
  853. objectType = "Block"
  854. },
  855. {
  856. name = "Diamond Block",
  857. size = Vector3.new(2.6, 2.6, 2.6),
  858. transparency = 0;
  859. frontTex = "rbxassetid://56749955",
  860. backTex = "rbxassetid://56749955",
  861. topTex = "rbxassetid://56749955",
  862. bottomTex = "rbxassetid://56749955",
  863. leftTex = "rbxassetid://56749955",
  864. rightTex = "rbxassetid://56749955",
  865. displayTex = "",
  866. sound = "rbxassetid://1016978163",
  867. soundVol = 2,
  868. hasGravity = false,
  869. objectType = "Block"
  870. },
  871. {
  872. name = "Oak Wood Planks",
  873. size = Vector3.new(2.6, 2.6, 2.6),
  874. transparency = 0;
  875. frontTex = "rbxassetid://346201871",
  876. backTex = "rbxassetid://346201871",
  877. topTex = "rbxassetid://346201871",
  878. bottomTex = "rbxassetid://346201871",
  879. leftTex = "rbxassetid://346201871",
  880. rightTex = "rbxassetid://346201871",
  881. displayTex = "",
  882. sound = "rbxassetid://507863457",
  883. soundVol = 2,
  884. hasGravity = false,
  885. objectType = "Block"
  886. },
  887. {
  888. name = "Oak Log",
  889. size = Vector3.new(2.6, 2.6, 2.6),
  890. transparency = 0;
  891. frontTex = "rbxassetid://71445924",
  892. backTex = "rbxassetid://71445924",
  893. topTex = "rbxassetid://152538557",
  894. bottomTex = "rbxassetid://152538557",
  895. leftTex = "rbxassetid://71445924",
  896. rightTex = "rbxassetid://71445924",
  897. displayTex = "",
  898. sound = "rbxassetid://507863457",
  899. soundVol = 2,
  900. hasGravity = false,
  901. objectType = "Block"
  902. }
  903. --[[{
  904. name = "Redstone",
  905. size = Vector3.new(2.6, 0.05, 2.6),
  906. transparency = 1;
  907. frontTex = "rbxassetid://151911305",
  908. backTex = "",
  909. topTex = "rbxassetid://151911305",
  910. bottomTex = "",
  911. leftTex = "",
  912. rightTex = "",
  913. displayTex = "rbxassetid://64124418",
  914. sound = "rbxassetid://1016978163",
  915. soundVol = 2,
  916. hasGravity = false,
  917. objectType = "Redstone Dust"
  918. },]]
  919. }
  920. function putTexture(part, frontF, backF, topF, bottomF, leftF, rightF, className)
  921. local faces = {"Front", "Back", "Top", "Bottom", "Left", "Right"}
  922. for i,f in pairs(faces) do
  923. local decal = Instance.new(className, part)
  924. if i == 1 then decal.Texture = frontF decal.Name = f end
  925. if i == 2 then decal.Texture = backF or frontF decal.Name = f end
  926. if i == 3 then decal.Texture = topF or frontF decal.Name = f end
  927. if i == 4 then decal.Texture = bottomF or frontF decal.Name = f end
  928. if i == 5 then decal.Texture = leftF or frontF decal.Name = f end
  929. if i == 6 then decal.Texture = rightF or frontF decal.Name = f end
  930. decal.Face = f
  931. end
  932. return part
  933. end
  934. function makeSquare(position, size, color, transparency, parent, zindex)
  935. local label = Instance.new("TextLabel", parent)
  936. label.Text = ""
  937. label.BorderSizePixel = 0
  938. label.BackgroundTransparency = transparency
  939. label.Position = position
  940. label.Size = size
  941. label.BackgroundColor3 = color
  942. if zindex == nil then label.ZIndex = 1 else label.ZIndex = zindex end
  943. return label
  944. end
  945. function makeImage(position, size, image, parent, zindex)
  946. local imglabel = Instance.new("ImageLabel", parent)
  947. imglabel.BorderSizePixel = 0
  948. imglabel.BackgroundTransparency = 1
  949. imglabel.Position = position
  950. imglabel.Size = size
  951. imglabel.Image = image
  952. if zindex == nil then imglabel.ZIndex = 1 else imglabel.ZIndex = zindex end
  953. return imglabel
  954. end
  955. function putInventorySlot(position, image, parent, zindex)
  956. local button = Instance.new("TextButton", parent)
  957. button.Position = position
  958. button.Size = UDim2.new(0, 36, 0, 36)
  959. button.BackgroundColor3 = Color3.new(139/255, 139/255, 139/255)
  960. button.Text = ""
  961. button.BorderSizePixel = 0
  962. button.ZIndex = zindex
  963. local imageLabel = Instance.new("ImageLabel", button)
  964. imageLabel.BackgroundTransparency = 0.9
  965. imageLabel.Position = UDim2.new(0, 2, 0, 2)
  966. imageLabel.Size = UDim2.new(0, 32, 0, 32)
  967. imageLabel.Image = image
  968. imageLabel.BorderSizePixel = 0
  969. imageLabel.ZIndex = zindex
  970. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 34, 0, 2),
  971. Color3.new(55/255, 55/255, 55/255), 0, button, zindex)
  972. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 2, 0, 34),
  973. Color3.new(55/255, 55/255, 55/255), 0, button, zindex)
  974. makeSquare(UDim2.new(0, 34, 0, 2), UDim2.new(0, 2, 0, 34),
  975. Color3.new(255/255, 255/255, 255/255), 0, button, zindex)
  976. makeSquare(UDim2.new(0, 2, 0, 34), UDim2.new(0, 34, 0, 2),
  977. Color3.new(255/255, 255/255, 255/255), 0, button, zindex)
  978. return button
  979. end
  980.  
  981. function AngleDifference(Angle1, Angle2)
  982. local Difference = {X = 0, Y = 0, Z = 0}
  983. Difference.X = Angle2.X - Angle1.X
  984.  
  985. if (Difference.X > 180) then
  986. Difference.X = Difference.X - 360
  987. elseif (Difference.X < -180) then
  988. Difference.X = Difference.X + 360
  989. end
  990.  
  991. Difference.Y = Angle2.Y - Angle1.Y
  992.  
  993. if (Difference.Y > 180) then
  994. Difference.Y = Difference.Y - 360
  995. elseif (Difference.Y < -180) then
  996. Difference.Y = Difference.Y + 360
  997. end
  998.  
  999. Difference.Z = Angle2.Z - Angle1.Z
  1000.  
  1001. if (Difference.Z > 180) then
  1002. Difference.Z = Difference.Z - 360
  1003. elseif (Difference.Z < -180) then
  1004. Difference.Z = Difference.Z + 360
  1005. end
  1006.  
  1007. return Vector3.new(Difference.X, Difference.Y, Difference.Z)
  1008. end
  1009.  
  1010. local draggingBlock = nil
  1011. function divide(x, d)
  1012. if x ~= 0 and d ~= 0 then
  1013. return x/d
  1014. else
  1015. return x
  1016. end
  1017. end -- so it doesn't divide by zero
  1018. function getDistance(v1, v2)
  1019. return math.abs((Vector3.new(math.abs(v2.X - v1.X), math.abs(v2.Y - v1.Y), math.abs(v2.Z - v1.Z))).Magnitude)
  1020. end
  1021. function SnapToGrid(x, gridX)
  1022. local x = math.floor((x / gridX) + 0.5) * gridX
  1023. return x
  1024. end
  1025. function round(x)
  1026. if x%2 ~= 0.5 then
  1027. return math.floor(x+0.5)
  1028. end
  1029. return x-0.5
  1030. end
  1031. function weldTo(part1, part2)
  1032. local weld = Instance.new("Weld", part1)
  1033. weld.Part0 = part1
  1034. weld.Part1 = part2
  1035. return weld
  1036. end
  1037. function getMagnitudeXZ(velocity)
  1038. return math.sqrt(math.abs(velocity.X)^2 + math.abs(velocity.Z)^2)
  1039. end
  1040. function findHumanoid(inst)
  1041. local find = inst
  1042. local hum = nil
  1043. repeat
  1044. if find.Name == "Workspace" then return nil end
  1045. find = find.Parent
  1046. hum = find:FindFirstChild("Humanoid")
  1047. until hum
  1048. --if hum then print("found!!") else print("aw... not found") end
  1049. --if hum.ClassName ~= "Humanoid" then hum = nil end
  1050. return hum
  1051. end
  1052. function getSideByLocation(loc)
  1053. local side = nil
  1054. if loc.X < 0 then side = "Left" end
  1055. if loc.X > 0 then side = "Right" end
  1056. if loc.Y > 0 then side = "Top" end
  1057. if loc.Y < 0 then side = "Bottom" end
  1058. if loc.Z < 0 then side = "Front" end
  1059. if loc.Z > 0 then side = "Back" end
  1060.  
  1061. if (math.abs(loc.X) > 0 and math.abs(loc.Y) > 0) or
  1062. (math.abs(loc.X) > 0 and math.abs(loc.Z) > 0) or
  1063. (math.abs(loc.Y) > 0 and math.abs(loc.Z) > 0)
  1064. then
  1065. return nil
  1066. end
  1067. return side
  1068. end
  1069. function getSideByLocationRedstone(loc)
  1070. local side = nil
  1071. if loc.X < 0 then side = "Left" end
  1072. if loc.X > 0 then side = "Right" end
  1073. if loc.Y > 0 then side = "Top" end
  1074. if loc.Y < 0 then side = "Bottom" end
  1075. if loc.Z < 0 then side = "Front" end
  1076. if loc.Z > 0 then side = "Back" end
  1077.  
  1078. if (math.abs(loc.X) > 0 and math.abs(loc.Y) > 0) or
  1079. (math.abs(loc.X) > 0 and math.abs(loc.Z) > 0) or
  1080. (math.abs(loc.Y) > 0 and math.abs(loc.Z) > 0)
  1081. then
  1082. return nil
  1083. end
  1084. return side
  1085. end
  1086. function getBlockAtRegion(region)
  1087. local blockFound = nil
  1088. for _,part in pairs(game.Workspace:FindPartsInRegion3(region, nil, math.huge)) do
  1089. local usePart = true
  1090. if part.Name == "Debris" then usePart = false end
  1091. if usePart == true then
  1092. blockFound = part
  1093. break
  1094. end
  1095. end
  1096. return blockFound
  1097. end
  1098. function getRedstoneAtRegion(region)
  1099. local blockFound = nil
  1100. for _,part in pairs(game.Workspace:FindPartsInRegion3(region, nil, math.huge)) do
  1101. if isRedstone(part) then
  1102. blockFound = part
  1103. break
  1104. end
  1105. end
  1106. return blockFound
  1107. end
  1108. function isRedstone(block)
  1109. local objType = block:FindFirstChild("ObjectType")
  1110. if objType then
  1111. if objType.Value == "Redstone Dust" then
  1112. return true
  1113. else
  1114. return false
  1115. end
  1116. end
  1117. end
  1118. function updateRedstoneDust(dust, leftBlk, rightBlk, topBlk, bottomBlk, frontBlk, backBlk, recursion)
  1119. local objType = nil
  1120. if dust then
  1121. objType = dust:FindFirstChild("ObjectType")
  1122. end
  1123.  
  1124. local redstoneDust = "rbxassetid://151911305"
  1125. local redstoneLine = "rbxassetid://151907047"
  1126. local redstoneCorner = "rbxassetid://151907106"
  1127. local redstoneT = "rbxassetid://151907156"
  1128. local redstoneCross = "rbxassetid://151906997"
  1129.  
  1130. local Rotation = 0
  1131.  
  1132. local theresRedstoneAtLeft = false
  1133. local theresRedstoneAtRight = false
  1134. local theresRedstoneAtFront = false
  1135. local theresRedstoneAtBack = false
  1136.  
  1137. if leftBlk then theresRedstoneAtLeft = isRedstone(leftBlk) end
  1138. if rightBlk then theresRedstoneAtRight = isRedstone(rightBlk) end
  1139. if frontBlk then theresRedstoneAtFront = isRedstone(frontBlk) end
  1140. if backBlk then theresRedstoneAtBack = isRedstone(backBlk) end
  1141.  
  1142. if objType then
  1143. if objType.Value == "Redstone Dust" then
  1144. local topDecal = dust:FindFirstChild("Top")
  1145. if topDecal then
  1146. if theresRedstoneAtBack == false and theresRedstoneAtFront == false and
  1147. theresRedstoneAtLeft == false and theresRedstoneAtRight == false then
  1148. topDecal.Texture = redstoneDust
  1149. Rotation = 0
  1150. end
  1151.  
  1152. if theresRedstoneAtLeft == true or theresRedstoneAtRight == true then
  1153. topDecal.Texture = redstoneLine
  1154. Rotation = 0
  1155. end
  1156.  
  1157. if theresRedstoneAtFront == true or theresRedstoneAtBack == true then
  1158. topDecal.Texture = redstoneLine
  1159. Rotation = 90
  1160. end
  1161.  
  1162. if theresRedstoneAtLeft == true and theresRedstoneAtBack == true then
  1163. topDecal.Texture = redstoneCorner
  1164. Rotation = 0
  1165. end
  1166.  
  1167. if theresRedstoneAtBack == true and theresRedstoneAtRight == true then
  1168. topDecal.Texture = redstoneCorner
  1169. Rotation = 90
  1170. end
  1171.  
  1172. if theresRedstoneAtRight == true and theresRedstoneAtFront == true then
  1173. topDecal.Texture = redstoneCorner
  1174. Rotation = 180
  1175. end
  1176.  
  1177. if theresRedstoneAtFront == true and theresRedstoneAtLeft == true then
  1178. topDecal.Texture = redstoneCorner
  1179. Rotation = -90
  1180. end
  1181.  
  1182. if theresRedstoneAtBack == true and theresRedstoneAtLeft == true
  1183. and theresRedstoneAtFront == true then
  1184. topDecal.Texture = redstoneT
  1185. Rotation = -90
  1186. end
  1187.  
  1188. if theresRedstoneAtLeft == true and theresRedstoneAtFront == true
  1189. and theresRedstoneAtRight == true then
  1190. topDecal.Texture = redstoneT
  1191. Rotation = -180
  1192. end
  1193.  
  1194. if theresRedstoneAtFront == true and theresRedstoneAtRight == true
  1195. and theresRedstoneAtBack == true then
  1196. topDecal.Texture = redstoneT
  1197. Rotation = 90
  1198. end
  1199.  
  1200. if theresRedstoneAtRight == true and theresRedstoneAtBack == true
  1201. and theresRedstoneAtLeft == true then
  1202. topDecal.Texture = redstoneT
  1203. Rotation = 0
  1204. end
  1205.  
  1206. if theresRedstoneAtLeft == true and theresRedstoneAtRight == true and
  1207. theresRedstoneAtFront == true and theresRedstoneAtBack == true then
  1208. topDecal.Texture = redstoneCross
  1209. Rotation = 0
  1210. end
  1211. end
  1212. else
  1213. error("Not redstone dust.")
  1214. end
  1215. end
  1216.  
  1217. if recursion == true then
  1218. local function updateTex(blockTarget)
  1219. local leftSide = nil
  1220. local rightSide = nil
  1221. local frontSide = nil
  1222. local backSide = nil
  1223.  
  1224. local Point1 = blockTarget.CFrame.p - Vector3.new(2.6, 0.1, 2.6)
  1225. local Point2 = blockTarget.CFrame.p + Vector3.new(2.6, 0.1, 2.6)
  1226. local Region = Region3.new(Point1, Point2)
  1227. for _,part in pairs(game.Workspace:FindPartsInRegion3(
  1228. Region,
  1229. nil,
  1230. math.huge
  1231. )) do
  1232. local objType = part:FindFirstChild("ObjectType")
  1233. if isRedstone(part) then
  1234. local side = getSideByLocationRedstone(blockTarget.CFrame.p - part.CFrame.p)
  1235. if side == "Left" then
  1236. leftSide = part
  1237. elseif side == "Right" then
  1238. rightSide = part
  1239. elseif side == "Front" then
  1240. frontSide = part
  1241. elseif side == "Back" then
  1242. backSide = part
  1243. elseif side == "Left Top" then
  1244. leftSide = part
  1245. elseif side == "Right Top" then
  1246. rightSide = part
  1247. elseif side == "Front Top" then
  1248. frontSide = part
  1249. elseif side == "Back Top" then
  1250. backSide = part
  1251. elseif side == "Left Bottom" then
  1252. leftSide = part
  1253. elseif side == "Right Bottom" then
  1254. rightSide = part
  1255. elseif side == "Front Bottom" then
  1256. frontSide = part
  1257. elseif side == "Back Bottom" then
  1258. backSide = part
  1259. end
  1260. end
  1261. end
  1262.  
  1263. updateRedstoneDust(blockTarget, leftSide, rightSide, nil, nil, frontSide, backSide, false)
  1264. end
  1265. if leftBlk and theresRedstoneAtLeft then updateTex(leftBlk) end
  1266. if rightBlk and theresRedstoneAtRight then updateTex(rightBlk) end
  1267. if frontBlk and theresRedstoneAtFront then updateTex(frontBlk) end
  1268. if backBlk and theresRedstoneAtBack then updateTex(backBlk) end
  1269. end
  1270.  
  1271. 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
  1272. end
  1273. function placeBlock(block, cFPos, Mouse)
  1274. if block == nil then
  1275. if Mouse.Target.Size.X <= 10 and Mouse.Target.Size.Y <= 10 and Mouse.Target.Size.Z <= 10 and Mouse.Target then
  1276. if Mouse.Target.Parent.Name ~= "Camera" then
  1277. --print(Mouse.Target:GetFullName())
  1278. local blkTar = Mouse.Target
  1279. --Mouse.Target.Parent = nil
  1280. local blockIsRedstone = isRedstone(blkTar)
  1281.  
  1282. local Point1 = blkTar.CFrame.p - Vector3.new(2.7, 2.7, 2.7)
  1283. local Point2 = blkTar.CFrame.p + Vector3.new(2.7, 2.7, 2.7)
  1284. local Region = Region3.new(Point1, Point2)
  1285. for _,part in pairs(game.Workspace:FindPartsInRegion3(
  1286. Region,
  1287. nil,
  1288. math.huge
  1289. )) do
  1290.  
  1291. if part:FindFirstChild("IsBlock") then
  1292. local side1 = getSideByLocation(blkTar.CFrame.p - part.CFrame.p)
  1293. if getSideByLocation(blkTar.CFrame.p - part.CFrame.p) then
  1294. local texture = part:FindFirstChild(side1)
  1295. if texture then
  1296. texture.Transparency = 0
  1297. end
  1298. end
  1299. end
  1300. end
  1301.  
  1302. for i = 1, 9 do
  1303. local part = Instance.new("Part", workspace)
  1304. part.Size = Vector3.new(0, 0, 0)
  1305. part.Transparency = 1
  1306. part.CanCollide = false
  1307. part.Velocity = Vector3.new(math.random(-5, 5), 5, math.random(-5, 5))
  1308. part.Name = "Debris"
  1309.  
  1310. part.CFrame =
  1311. Mouse.Target.CFrame *
  1312. 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))
  1313.  
  1314. part.CustomPhysicalProperties = PhysicalProperties.new(0, 0.2, 0, 100, 100)
  1315.  
  1316. local billboard = Instance.new("BillboardGui", part)
  1317. billboard.Size = UDim2.new(1.2, 0, 1.2, 0)
  1318.  
  1319. local clipDescendant = Instance.new("TextLabel", billboard)
  1320. clipDescendant.Size = UDim2.new(0.5, 0, 0.5, 0)
  1321. clipDescendant.BackgroundTransparency = 1
  1322. clipDescendant.Text = ""
  1323. clipDescendant.ClipsDescendants = true
  1324.  
  1325. local img = Instance.new("ImageLabel", clipDescendant)
  1326. img.Size = UDim2.new(2, 0, 2, 0)
  1327. img.BackgroundTransparency = 1
  1328. img.Position = UDim2.new(math.random(-70, 70)/100, 0, math.random(-70, 70)/100, 0)
  1329.  
  1330. local tex = blkTar:FindFirstChild("Front")
  1331. if tex then
  1332. img.Image = tex.Texture
  1333. else
  1334. img.Image = "rbxassetid://744949545"
  1335. end
  1336.  
  1337. if img.Image == "rbxassetid://744949545" then
  1338. img.ImageColor3 = blkTar.Color
  1339. end
  1340.  
  1341. part.Touched:connect(function(prt)
  1342. if prt ~= blkTar then
  1343. part.CanCollide = true
  1344. end
  1345. end)
  1346.  
  1347. coroutine.resume(coroutine.create(function()
  1348. wait(math.random(50, 65)/100)
  1349. part:Destroy()
  1350. end))
  1351. --part.Anchored = false
  1352. end
  1353. blkTar:Destroy()
  1354. if blockIsRedstone == true then
  1355. local leftSide = nil
  1356. local rightSide = nil
  1357. local frontSide = nil
  1358. local backSide = nil
  1359.  
  1360. local Point1 = blkTar.CFrame.p - Vector3.new(2.6, 0.1, 2.6)
  1361. local Point2 = blkTar.CFrame.p + Vector3.new(2.6, 0.1, 2.6)
  1362. local Region = Region3.new(Point1, Point2)
  1363. for _,part in pairs(game.Workspace:FindPartsInRegion3(
  1364. Region,
  1365. nil,
  1366. math.huge
  1367. )) do
  1368. local objType = part:FindFirstChild("ObjectType")
  1369. if isRedstone(part) then
  1370. local side = getSideByLocationRedstone(blkTar.CFrame.p - part.CFrame.p)
  1371. if side == "Left" then
  1372. leftSide = part
  1373. elseif side == "Right" then
  1374. rightSide = part
  1375. elseif side == "Front" then
  1376. frontSide = part
  1377. elseif side == "Back" then
  1378. backSide = part
  1379. elseif side == "Left Top" then
  1380. leftSide = part
  1381. elseif side == "Right Top" then
  1382. rightSide = part
  1383. elseif side == "Front Top" then
  1384. frontSide = part
  1385. elseif side == "Back Top" then
  1386. backSide = part
  1387. elseif side == "Left Bottom" then
  1388. leftSide = part
  1389. elseif side == "Right Bottom" then
  1390. rightSide = part
  1391. elseif side == "Front Bottom" then
  1392. frontSide = part
  1393. elseif side == "Back Bottom" then
  1394. backSide = part
  1395. end
  1396. end
  1397. end
  1398.  
  1399. updateRedstoneDust(nil, leftSide, rightSide, nil, nil, frontSide, backSide, true)
  1400. end
  1401. end
  1402. end
  1403. return nil
  1404. else
  1405. local blkMouseTarget = Mouse.Target
  1406.  
  1407. local blockPlaced = Instance.new("Part", workspace)
  1408. blockPlaced.Material = "Fabric"
  1409. blockPlaced.Transparency = block.transparency
  1410. blockPlaced.Anchored = true
  1411. blockPlaced.Size = block.size
  1412.  
  1413. blockPlaced.CFrame = cFPos
  1414.  
  1415. local blockType = Instance.new("StringValue", blockPlaced)
  1416. blockType.Name = "ObjectType"
  1417. blockType.Value = block.objectType
  1418.  
  1419. blockPlaced.Name = block.name
  1420. putTexture(blockPlaced, block.frontTex, block.backTex,
  1421. block.topTex, block.bottomTex, block.leftTex, block.rightTex, "Texture")
  1422.  
  1423. if block.objectType == "Slab" then
  1424. blockPlaced.Size = blockPlaced.Size / Vector3.new(1, 2, 1)
  1425. blockPlaced.CFrame = blockPlaced.CFrame * CFrame.new(0, -blockPlaced.Size.Y/2, 0)
  1426. elseif block.objectType == "Redstone Dust" then
  1427. blockPlaced.CFrame = blockPlaced.CFrame * CFrame.new(0, -1.3, 0)
  1428. blockPlaced.CanCollide = false
  1429.  
  1430. local canPlace = false
  1431.  
  1432. if isRedstone(blkMouseTarget) == true then
  1433. blockPlaced:Destroy()
  1434. return
  1435. end
  1436.  
  1437. local partBelow = getBlockAtRegion(Region3.new(
  1438. blockPlaced.CFrame.p - Vector3.new(1, 1, 1),
  1439. blockPlaced.CFrame.p + Vector3.new(1, 1, 1)
  1440. ))
  1441.  
  1442. if partBelow then
  1443. local targetObjType = partBelow:FindFirstChild("ObjectType")
  1444. if targetObjType then
  1445. if targetObjType.Value == "Block" then
  1446. canPlace = true
  1447. end
  1448. end
  1449. end
  1450.  
  1451. if canPlace == false then
  1452. blockPlaced:Destroy()
  1453. return
  1454. end
  1455.  
  1456. local leftSide = nil
  1457. local rightSide = nil
  1458. local frontSide = nil
  1459. local backSide = nil
  1460.  
  1461. local Point1 = blockPlaced.CFrame.p - Vector3.new(2.6, 0.1, 2.6)
  1462. local Point2 = blockPlaced.CFrame.p + Vector3.new(2.6, 0.1, 2.6)
  1463. local Region = Region3.new(Point1, Point2)
  1464. for _,part in pairs(game.Workspace:FindPartsInRegion3(
  1465. Region,
  1466. nil,
  1467. math.huge
  1468. )) do
  1469. local objType = part:FindFirstChild("ObjectType")
  1470. if isRedstone(part) then
  1471.  
  1472. local side = getSideByLocationRedstone(blockPlaced.CFrame.p - part.CFrame.p)
  1473. if side == "Left" then
  1474. leftSide = part
  1475. elseif side == "Right" then
  1476. rightSide = part
  1477. elseif side == "Front" then
  1478. frontSide = part
  1479. elseif side == "Back" then
  1480. backSide = part
  1481. elseif side == "Left Top" then
  1482. leftSide = part
  1483. elseif side == "Right Top" then
  1484. rightSide = part
  1485. elseif side == "Front Top" then
  1486. frontSide = part
  1487. elseif side == "Back Top" then
  1488. backSide = part
  1489. elseif side == "Left Bottom" then
  1490. leftSide = part
  1491. elseif side == "Right Bottom" then
  1492. rightSide = part
  1493. elseif side == "Front Bottom" then
  1494. frontSide = part
  1495. elseif side == "Back Bottom" then
  1496. backSide = part
  1497. end
  1498.  
  1499.  
  1500. --if getSideByLocation(cFPos.p - part.CFrame.p) then
  1501. -- local texture = part:FindFirstChild(side1)
  1502. -- if texture then
  1503. -- texture.Transparency = 1
  1504. -- end
  1505. --end
  1506. --[[local side2 = getSideByLocation(part.CFrame.p - cFPos.p)
  1507. if getSideByLocation(cFPos.p - part.CFrame.p) then
  1508. local texture = blockPlaced:FindFirstChild(side2)
  1509. if texture then
  1510. texture.Transparency = 1
  1511. end
  1512. end]]
  1513. end
  1514. end
  1515.  
  1516. updateRedstoneDust(blockPlaced, leftSide, rightSide, nil, nil, frontSide, backSide, true)
  1517.  
  1518. --local partBelow = getBlockAtRegion(Region3.new(
  1519. -- blockPlaced.CFrame.p - Vector3.new(1, 1, 1),
  1520. -- blockPlaced.CFrame.p + Vector3.new(1, 1, 1)
  1521. --))
  1522. end
  1523.  
  1524. if Mouse.Target.Name == block.name then
  1525. local targetObjType = Mouse.Target:FindFirstChild("ObjectType")
  1526. if targetObjType then
  1527. if targetObjType.Value == "Slab" then
  1528. local side = Mouse.TargetSurface.Name --getSideByLocation(Mouse.Target.Position - cFPos.p)
  1529. if side == "Bottom" or side == "Top" then
  1530. Mouse.Target.Size = Mouse.Target.Size * Vector3.new(1, 2, 1)
  1531. Mouse.Target.CFrame = Mouse.Target.CFrame * CFrame.new(0, blockPlaced.Size.Y/2, 0)
  1532.  
  1533. targetObjType.Value = "Block"
  1534.  
  1535. blockPlaced:Destroy()
  1536. return
  1537. end
  1538. end
  1539. end
  1540. end
  1541.  
  1542. local Point1 = cFPos.p - Vector3.new(2.7, 2.7, 2.7)
  1543. local Point2 = cFPos.p + Vector3.new(2.7, 2.7, 2.7)
  1544. local Region = Region3.new(Point1, Point2)
  1545. for _,part in pairs(game.Workspace:FindPartsInRegion3(
  1546. Region,
  1547. nil,
  1548. math.huge
  1549. )) do
  1550. local objType = part:FindFirstChild("ObjectType")
  1551. if part:FindFirstChild("IsBlock") and objType then
  1552. local doNothing = false
  1553. if objType.Value == "Slab" or block.objectType == "Slab" then doNothing = true end
  1554. if part.Name == blockPlaced.Name and doNothing == false then
  1555. local side1 = getSideByLocation(cFPos.p - part.CFrame.p)
  1556. if getSideByLocation(cFPos.p - part.CFrame.p) then
  1557. local texture = part:FindFirstChild(side1)
  1558. if texture then
  1559. texture.Transparency = 1
  1560. end
  1561. end
  1562. local side2 = getSideByLocation(part.CFrame.p - cFPos.p)
  1563. if getSideByLocation(cFPos.p - part.CFrame.p) then
  1564. local texture = blockPlaced:FindFirstChild(side2)
  1565. if texture then
  1566. texture.Transparency = 1
  1567. end
  1568. end
  1569. end
  1570. end
  1571. end
  1572.  
  1573.  
  1574. local isBlock = Instance.new("CFrameValue", blockPlaced)
  1575. isBlock.Name = "IsBlock"
  1576.  
  1577. if block.hasGravity == true then
  1578. local connectedTo = Instance.new("ObjectValue", blockPlaced)
  1579. connectedTo.Name = "ConnectedTo"
  1580. blockPlaced.Anchored = false
  1581. blockPlaced.CanCollide = false
  1582. local detector = Instance.new("Part", workspace:WaitForChild("Camera"))
  1583. detector.Transparency = 1
  1584. detector.CanCollide = false
  1585. detector.Size = Vector3.new(1, 0, 1)
  1586. local weldDetector = Instance.new("Motor6D", detector)
  1587. weldDetector.Part0 = detector
  1588. weldDetector.Part1 = blockPlaced
  1589. weldDetector.C1 = CFrame.new(0, -blockPlaced.Size.Y/2, 0)
  1590. local landed = false
  1591. local function fallingBlock()
  1592. coroutine.resume(coroutine.create(function()
  1593. local falling = blockPlaced:FindFirstChild("IsFalling") or Instance.new("CFrameValue", blockPlaced)
  1594. falling.Name = "IsFalling"
  1595. local grav = 0
  1596. while RS:wait() do
  1597. if landed then falling:Destroy() break end
  1598. grav = math.max(-1, grav - 0.0025)
  1599. --blockPlaced.CFrame = CFrame.new(cFPos.X, blockPlaced.CFrame.Y + grav, cFPos.Z)
  1600. end
  1601. end))
  1602. end
  1603. fallingBlock()
  1604. detector.Touched:connect(function(part)
  1605. if blockPlaced.Anchored == false and part ~= blockPlaced and part.Name ~= "Debris" and part:FindFirstChild("IsFalling") == nil and findHumanoid(part) == nil then
  1606. landed = true
  1607. blockPlaced.CanCollide = true
  1608. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  1609. blockPlaced.Anchored = true
  1610. connectedTo.Value = part
  1611. local yOrigin = part.CFrame.Y + (blockPlaced.Size.Y/2) + (part.Size.Y/2)
  1612. blockPlaced.CFrame = CFrame.new(cFPos.X, yOrigin, cFPos.Z)
  1613. --detector:Destroy()
  1614. local falling = false
  1615. part.Changed:connect(function()
  1616. if part.Position.Y ~= yOrigin and falling == false then
  1617. falling = true
  1618. wait(0.075)
  1619. landed = false
  1620. blockPlaced.Anchored = false
  1621. blockPlaced.CanCollide = false
  1622. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  1623. fallingBlock()
  1624. falling = false
  1625. end
  1626. end)
  1627. workspace.ChildRemoved:connect(function()
  1628. --print("hi")
  1629. if connectedTo.Value.Parent == nil and falling == false then
  1630. falling = true
  1631. landed = false
  1632. blockPlaced.Anchored = false
  1633. blockPlaced.CanCollide = false
  1634. blockPlaced.Velocity = Vector3.new(0, 0, 0)
  1635. fallingBlock()
  1636. end
  1637. end)
  1638. end
  1639. end)
  1640. end
  1641.  
  1642. local blockSound = Instance.new("Sound", blockPlaced)
  1643. blockSound.SoundId = block.sound
  1644. blockSound.Volume = block.soundVol
  1645. blockSound.Pitch = math.random(95, 105)/100
  1646. blockSound.PlayOnRemove = true
  1647. blockSound:Play()
  1648. return blockPlaced
  1649. end
  1650. end
  1651. faces = {"http://www.roblox.com/asset/?id=36047310"}
  1652. if Player then
  1653. local char = Player.Character
  1654. if char then
  1655. for _,cM in pairs(char:GetChildren()) do
  1656. if cM.ClassName == "CharacterMesh" then cM:Destroy() end
  1657. end
  1658. end
  1659.  
  1660. local humRootPart = char:WaitForChild("HumanoidRootPart")
  1661. local head = char:WaitForChild("Head")
  1662. local torso = char:WaitForChild("Torso")
  1663. local lArm = char:WaitForChild("Left Arm")
  1664. local rArm = char:WaitForChild("Right Arm")
  1665. local lLeg = char:WaitForChild("Left Leg")
  1666. local rLeg = char:WaitForChild("Right Leg")
  1667.  
  1668. local humanoid = char:WaitForChild("Humanoid")
  1669. char.Humanoid:ClearAllChildren()
  1670. humanoid.HipHeight = 0.3
  1671. humanoid.AutoRotate = true
  1672. --humanoid.Parent = nil
  1673.  
  1674. if char:FindFirstChild("Animate") then
  1675. char.Animate:Remove()
  1676. end
  1677. headdecal6 = Instance.new("Decal",head)
  1678. headdecal6.Face = "Front"
  1679. headdecal6.Texture = faces[math.random(1,#faces)]
  1680. if headdecal6.Texture == "http://www.roblox.com/asset/?id=36047310" then
  1681. headdecal1 = Instance.new("Decal",head)
  1682. headdecal1.Face = "Left"
  1683. headdecal1.Texture = "http://www.roblox.com/asset/?id=36047323"
  1684. headdecal2 = Instance.new("Decal",head)
  1685. headdecal2.Face = "Bottom"
  1686. headdecal2.Texture = "http://www.roblox.com/asset/?id=36047347"
  1687. headdecal3 = Instance.new("Decal",head)
  1688. headdecal3.Face = "Top"
  1689. headdecal3.Texture = "http://www.roblox.com/asset/?id=36047341"
  1690. headdecal4 = Instance.new("Decal",head)
  1691. headdecal4.Face = "Back"
  1692. headdecal4.Texture = "http://www.roblox.com/asset/?id=36047330"
  1693. headdecal5 = Instance.new("Decal",head)
  1694. headdecal5.Face = "Right"
  1695. headdecal5.Texture = "http://www.roblox.com/asset/?id=36047315"
  1696. local hit0 = Instance.new("Part", char)
  1697. hit0.Name = "DamagePart"
  1698. hit0.BrickColor = BrickColor.new("Bright red")
  1699. hit0.Material = "SmoothPlastic"
  1700. hit0.Transparency = 1
  1701. hit0.Size = Vector3.new(lArm.Size.X + 0.001, lArm.Size.Y + 0.001, lArm.Size.Z + 0.001)
  1702. hit0.CanCollide = false
  1703. weldd = Instance.new("Weld",hit0)
  1704. weldd.Part0 = lArm
  1705. weldd.Part1 = hit0
  1706. local hit1 = Instance.new("Part", char)
  1707. hit1.Name = "DamagePart"
  1708. hit1.BrickColor = BrickColor.new("Bright red")
  1709. hit1.Material = "SmoothPlastic"
  1710. hit1.Transparency = 1
  1711. hit1.Size = Vector3.new(rArm.Size.X + 0.001, rArm.Size.Y + 0.001, rArm.Size.Z + 0.001)
  1712. hit1.CanCollide = false
  1713. welddd = Instance.new("Weld",hit1)
  1714. welddd.Part0 = rArm
  1715. welddd.Part1 = hit1
  1716. torsodecal1 = Instance.new("Decal",torso)
  1717. torsodecal1.Face = "Left"
  1718. torsodecal1.Texture = "http://www.roblox.com/asset/?id=38934762"
  1719. torsodecal2 = Instance.new("Decal",torso)
  1720. torsodecal2.Face = "Bottom"
  1721. torsodecal2.Texture = "http://www.roblox.com/asset/?id=38934740"
  1722. torsodecal3 = Instance.new("Decal",torso)
  1723. torsodecal3.Face = "Top"
  1724. torsodecal3.Texture = "http://www.roblox.com/asset/?id=38934780"
  1725. torsodecal4 = Instance.new("Decal",torso)
  1726. torsodecal4.Face = "Back"
  1727. torsodecal4.Texture = "http://www.roblox.com/asset/?id=38934731"
  1728. torsodecal5 = Instance.new("Decal",torso)
  1729. torsodecal5.Face = "Right"
  1730. torsodecal5.Texture = "http://www.roblox.com/asset/?id=38934762"
  1731. torsodecal6 = Instance.new("Decal",torso)
  1732. torsodecal6.Face = "Front"
  1733. torsodecal6.Texture = "http://www.roblox.com/asset/?id=38934753"
  1734. for i,v in pairs(char:GetChildren()) do
  1735. if v.ClassName == "Part" and v.Name == "Left Leg" then
  1736. torsodecal1 = Instance.new("Decal",v)
  1737. torsodecal1.Face = "Left"
  1738. torsodecal1.Texture = "http://www.roblox.com/asset/?id=38936255"
  1739. torsodecal2 = Instance.new("Decal",v)
  1740. torsodecal2.Face = "Bottom"
  1741. torsodecal2.Texture = "http://www.roblox.com/asset/?id=38934712"
  1742. torsodecal3 = Instance.new("Decal",v)
  1743. torsodecal3.Face = "Top"
  1744. torsodecal3.Texture = "http://www.roblox.com/asset/?id=38934719"
  1745. torsodecal4 = Instance.new("Decal",v)
  1746. torsodecal4.Face = "Back"
  1747. torsodecal4.Texture = "http://www.roblox.com/asset/?id=38936209"
  1748. torsodecal5 = Instance.new("Decal",v)
  1749. torsodecal5.Face = "Right"
  1750. torsodecal5.Texture = "http://www.roblox.com/asset/?id=38936242"
  1751. torsodecal6 = Instance.new("Decal",v)
  1752. torsodecal6.Face = "Front"
  1753. torsodecal6.Texture = "http://www.roblox.com/asset/?id=38936226"
  1754. elseif v.ClassName == "Part" and v.Name == "Right Leg" then
  1755. torsodecal1 = Instance.new("Decal",v)
  1756. torsodecal1.Face = "Left"
  1757. torsodecal1.Texture = "http://www.roblox.com/asset/?id=38936242"
  1758. torsodecal2 = Instance.new("Decal",v)
  1759. torsodecal2.Face = "Bottom"
  1760. torsodecal2.Texture = "http://www.roblox.com/asset/?id=38934712"
  1761. torsodecal3 = Instance.new("Decal",v)
  1762. torsodecal3.Face = "Top"
  1763. torsodecal3.Texture = "http://www.roblox.com/asset/?id=38934719"
  1764. torsodecal4 = Instance.new("Decal",v)
  1765. torsodecal4.Face = "Back"
  1766. torsodecal4.Texture = "http://www.roblox.com/asset/?id=38936226"
  1767. torsodecal5 = Instance.new("Decal",v)
  1768. torsodecal5.Face = "Right"
  1769. torsodecal5.Texture = "http://www.roblox.com/asset/?id=38936255"
  1770. torsodecal6 = Instance.new("Decal",v)
  1771. torsodecal6.Face = "Front"
  1772. torsodecal6.Texture = "http://www.roblox.com/asset/?id=38936209"
  1773. elseif v.ClassName == "Part" and v.Name == "Left Arm" then
  1774. torsodecal1 = Instance.new("Decal",v)
  1775. torsodecal1.Face = "Left"
  1776. torsodecal1.Texture = "http://www.roblox.com/asset/?id=38934601"
  1777. torsodecal2 = Instance.new("Decal",v)
  1778. torsodecal2.Face = "Bottom"
  1779. torsodecal2.Texture = "http://www.roblox.com/asset/?id=38934568"
  1780. torsodecal3 = Instance.new("Decal",v)
  1781. torsodecal3.Face = "Top"
  1782. torsodecal3.Texture = "http://www.roblox.com/asset/?id=38934613"
  1783. torsodecal4 = Instance.new("Decal",v)
  1784. torsodecal4.Face = "Back"
  1785. torsodecal4.Texture = "http://www.roblox.com/asset/?id=38934560"
  1786. torsodecal5 = Instance.new("Decal",v)
  1787. torsodecal5.Face = "Right"
  1788. torsodecal5.Texture = "http://www.roblox.com/asset/?id=38934591"
  1789. torsodecal6 = Instance.new("Decal",v)
  1790. torsodecal6.Face = "Front"
  1791. torsodecal6.Texture = "http://www.roblox.com/asset/?id=38934581"
  1792. elseif v.ClassName == "Part" and v.Name == "Right Arm" then
  1793. torsodecal1 = Instance.new("Decal",v)
  1794. torsodecal1.Face = "Left"
  1795. torsodecal1.Texture = "http://www.roblox.com/asset/?id=38934601"
  1796. torsodecal2 = Instance.new("Decal",v)
  1797. torsodecal2.Face = "Bottom"
  1798. torsodecal2.Texture = "http://www.roblox.com/asset/?id=38934568"
  1799. torsodecal3 = Instance.new("Decal",v)
  1800. torsodecal3.Face = "Top"
  1801. torsodecal3.Texture = "http://www.roblox.com/asset/?id=38934613"
  1802. torsodecal4 = Instance.new("Decal",v)
  1803. torsodecal4.Face = "Back"
  1804. torsodecal4.Texture = "http://www.roblox.com/asset/?id=38934581"
  1805. torsodecal5 = Instance.new("Decal",v)
  1806. torsodecal5.Face = "Right"
  1807. torsodecal5.Texture = "http://www.roblox.com/asset/?id=38934591"
  1808. torsodecal6 = Instance.new("Decal",v)
  1809. torsodecal6.Face = "Front"
  1810. torsodecal6.Texture = "http://www.roblox.com/asset/?id=38934560"
  1811. end
  1812. end
  1813. end
  1814. head.Size = Vector3.new(1.3, 1.3, 1.3)
  1815. head:WaitForChild("Mesh"):Destroy()
  1816. head:WaitForChild("face"):Destroy()
  1817.  
  1818. torso.Size = Vector3.new(1.3, 1.95, 0.65)
  1819. lArm.Size = Vector3.new(0.65, 1.95, 0.65)
  1820. rArm.Size = Vector3.new(0.65, 1.95, 0.65)
  1821. lLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  1822. rLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  1823. -- now for the real stuff
  1824. -- |
  1825. -- |
  1826. -- V
  1827. Instance.new("BlockMesh", torso)
  1828. Instance.new("BlockMesh", lArm)
  1829. Instance.new("BlockMesh", rArm)
  1830. Instance.new("BlockMesh", lLeg)
  1831. Instance.new("BlockMesh", rLeg)
  1832.  
  1833. local camera = workspace.Camera
  1834.  
  1835. local camPart = Instance.new("Part", camera)
  1836. camPart.Size = Vector3.new(0, 0, 0)
  1837. camPart.CFrame = camera.CFrame
  1838. camPart.CanCollide = false
  1839. camPart.Anchored = true
  1840. camPart.Transparency = 1
  1841.  
  1842.  
  1843. -- welding doesn't really work.
  1844. --local cameraHandWeld = Instance.new("Motor6D", camPart)
  1845. --cameraHandWeld.Part0 = camPart
  1846. --cameraHandWeld.Part1 = cameraHand
  1847. --cameraHandWeld.C0 = CFrame.new(5, 0, 0)
  1848.  
  1849. local rootJoint = torso:FindFirstChild("RootJoint") or Instance.new("Motor6D", torso)
  1850. rootJoint.Name = "RootJoint"
  1851. rootJoint.Part0 = humRootPart
  1852. rootJoint.Part1 = torso
  1853. rootJoint.C1 = CFrame.new(0, 0.05, 0)
  1854.  
  1855. remoteevent = Instance.new("RemoteEvent",char)
  1856. remoteevent.Name = "SteveFunction"
  1857. local neck = torso:WaitForChild("Neck")
  1858. neck.Name = "Neck"
  1859. neck.Part0 = head
  1860. neck.Part1 = torso
  1861. remoteevent.OnServerEvent:Connect(function(plr,a,b)
  1862. necka = plr.Character.Torso.Neck
  1863. necka.C0 = a
  1864. necka.C1 = b
  1865. end)
  1866. NLS([[
  1867. local sneaking = 0
  1868. local ticks = 0
  1869. local RS = game:GetService("RunService").RenderStepped
  1870. local player = owner
  1871. local bodyRot = CFrame.new(0, 0, 0)
  1872. local mouse = player:GetMouse()
  1873. mouse.KeyDown:Connect(function(key)
  1874. if key == "q" then
  1875. sneaking = 1
  1876. end
  1877. end)
  1878. mouse.KeyUp:Connect(function(key)
  1879. if key == "q" then
  1880. sneaking = 0
  1881. end
  1882. end)
  1883. char = player.Character
  1884. local head = char:WaitForChild("Head")
  1885. local remoteevent = char:WaitForChild("SteveFunction")
  1886. remoteevent.Name = "SteveEvent"
  1887. local torso = char:WaitForChild("Torso")
  1888. local humanoid = char:WaitForChild("Humanoid")
  1889. humanoid.AutoRotate = false
  1890. neck = torso:WaitForChild("Neck")
  1891. local humRootPart = char:WaitForChild("HumanoidRootPart")
  1892. camera = workspace.CurrentCamera
  1893. local camPart = Instance.new("Part", char)
  1894. camPart.Size = Vector3.new(0, 0, 0)
  1895. camPart.CFrame = camera.CFrame
  1896. camPart.CanCollide = false
  1897. camPart.Anchored = true
  1898. camPart.Transparency = 1
  1899. local lastCamRot = camPart.Orientation
  1900. function AngleDifference(Angle1, Angle2)
  1901. local Difference = {X = 0, Y = 0, Z = 0}
  1902. Difference.X = Angle2.X - Angle1.X
  1903.  
  1904. if (Difference.X > 180) then
  1905. Difference.X = Difference.X - 360
  1906. elseif (Difference.X < -180) then
  1907. Difference.X = Difference.X + 360
  1908. end
  1909.  
  1910. Difference.Y = Angle2.Y - Angle1.Y
  1911.  
  1912. if (Difference.Y > 180) then
  1913. Difference.Y = Difference.Y - 360
  1914. elseif (Difference.Y < -180) then
  1915. Difference.Y = Difference.Y + 360
  1916. end
  1917.  
  1918. Difference.Z = Angle2.Z - Angle1.Z
  1919.  
  1920. if (Difference.Z > 180) then
  1921. Difference.Z = Difference.Z - 360
  1922. elseif (Difference.Z < -180) then
  1923. Difference.Z = Difference.Z + 360
  1924. end
  1925.  
  1926. return Vector3.new(Difference.X, Difference.Y, Difference.Z)
  1927. end
  1928. game:GetService("RunService").RenderStepped:Connect(function()
  1929. if char:FindFirstChild("MobileCrouching") then
  1930. sneaking = 1
  1931. else
  1932. sneaking = 0
  1933. end
  1934. local remoteevent = char:WaitForChild("SteveEvent")
  1935. camPart.CFrame = camera.CFrame
  1936. local neckYRot = math.rad(camPart.Orientation.Y - torso.Orientation.Y)
  1937. local rotX = math.deg(math.atan2(humanoid.MoveDirection.Z, humanoid.MoveDirection.X)) + 90
  1938. if humanoid.MoveDirection ~= Vector3.new(0, 0, 0) then
  1939. --print(rotX)
  1940. bodyRot = bodyRot:lerp(CFrame.Angles(0, -math.rad(rotX), 0), 0.125)
  1941. humRootPart.CFrame = CFrame.new(humRootPart.CFrame.p.X, humRootPart.CFrame.p.Y, humRootPart.CFrame.p.Z) * bodyRot
  1942. end
  1943. local neckYRot = math.rad(camPart.Orientation.Y - torso.Orientation.Y)
  1944. neck.C1 = CFrame.new(0, 0.975, 0) * CFrame.fromEulerAnglesXYZ(math.rad(sneaking*45), neckYRot, 0)
  1945. neck.C0 = CFrame.new(0, -0.65, 0) * CFrame.Angles(-math.rad(camPart.Orientation.X - torso.Orientation.X - (sneaking*45)), 0, 0)
  1946.  
  1947. local oldTorsoOrientation = torso.Orientation
  1948. if AngleDifference(camPart.Orientation, torso.Orientation).Y > 45 then
  1949. 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)
  1950. bodyRot = CFrame.Angles(0, math.rad(head.Orientation.Y + 45), 0)
  1951. --print("-45")
  1952. elseif AngleDifference(camPart.Orientation, torso.Orientation).Y < -45 then
  1953. 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)
  1954. bodyRot = CFrame.Angles(0, math.rad(head.Orientation.Y - 45), 0)
  1955. --print("45")
  1956. end
  1957.  
  1958. lastCamRot = camPart.Orientation
  1959. neck.C1 = neck.C1 * CFrame.fromEulerAnglesXYZ(0, -math.rad(AngleDifference(oldTorsoOrientation, torso.Orientation).Y), 0)
  1960. ticks = ticks + 1
  1961. if owner.Character:WaitForChild("SteveEvent") then
  1962. owner.Character.SteveEvent:FireServer (neck.C0,neck.C1)
  1963. end
  1964. end)
  1965. ]], char)
  1966. local lS = Instance.new("Motor6D", torso)
  1967. lS.Name = "Left Shoulder"
  1968. lS.Part0 = lArm
  1969. lS.Part1 = torso
  1970. lS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  1971. lS.C1 = CFrame.new(0.65, 0.975, 0)
  1972.  
  1973. local rS = Instance.new("Motor6D", torso)
  1974. rS.Name = "Right Shoulder"
  1975. rS.Part0 = rArm
  1976. rS.Part1 = torso
  1977. rS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  1978. rS.C1 = CFrame.new(-0.65, 0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  1979.  
  1980. local lH = Instance.new("Motor6D", torso)
  1981. lH.Name = "Left Hip"
  1982. lH.Part0 = lLeg
  1983. lH.Part1 = torso
  1984. lH.C0 = CFrame.new(0, 0.975, 0)
  1985. lH.C1 = CFrame.new(0.325, -0.975, 0)-- * CFrame.Angles(0, 0, 0)
  1986.  
  1987. local rH = Instance.new("Motor6D", torso)
  1988. rH.Name = "Right Hip"
  1989. rH.Part0 = rLeg
  1990. rH.Part1 = torso
  1991. rH.C0 = CFrame.new(0, 0.975, 0)
  1992. rH.C1 = CFrame.new(-0.325, -0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  1993.  
  1994. for _,p in pairs(char:GetChildren()) do
  1995. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  1996. local hit = Instance.new("Part", char)
  1997. hit.Name = "DamagePart"
  1998. hit.BrickColor = BrickColor.new("Bright red")
  1999. hit.Material = "SmoothPlastic"
  2000. hit.Transparency = 1
  2001. hit.Size = Vector3.new(p.Size.X + 0.05, p.Size.Y + 0.05, p.Size.Z + 0.05)
  2002. hit.CanCollide = false
  2003. weldTo(hit, p)
  2004. end
  2005. end
  2006.  
  2007. wait(0.25)
  2008.  
  2009. -- local billNameTag = Instance.new("BillboardGui", char)
  2010. -- billNameTag.Size = UDim2.new(1, 0, 1, 0)
  2011. -- billNameTag.Adornee = head
  2012. -- billNameTag.PlayerToHideFrom = Player
  2013. --
  2014. -- local textLabel = Instance.new("TextLabel", billNameTag)
  2015. -- textLabel.Font = "Arcade"
  2016. -- --textLabel.Size = UDim2.new(1, 0, 1, 0)
  2017. -- textLabel.TextScaled = true
  2018. -- --textLabel.TextSize = 100
  2019. -- textLabel.Text = targetName
  2020. -- textLabel.Size = UDim2.new(textLabel.TextBounds.X/100, 0, 0.75, 0)
  2021. -- textLabel.BorderSizePixel = 0
  2022. -- textLabel.BackgroundColor3 = Color3.new(0, 0, 0)
  2023. -- textLabel.TextColor3 = Color3.new(1, 1, 1)
  2024. -- textLabel.BackgroundTransparency = 0.5
  2025. --
  2026. -- if textLabel.Text == "Depr1" then
  2027. -- textLabel.TextColor3 = Color3.new(1, 0.75, 0)
  2028. -- end
  2029. --
  2030. -- billNameTag.SizeOffset = Vector2.new(-textLabel.TextBounds.X/200 + 0.5, 0)
  2031. -- billNameTag.StudsOffset = Vector3.new(0, 1.5, 0)
  2032.  
  2033.  
  2034. --humanoid.Parent = char
  2035.  
  2036. local ticks = 0
  2037. local times = 0
  2038.  
  2039. local walkAnim = 0
  2040. local increaseWalkAnim = 1
  2041.  
  2042. local idleAnimRotX = 0
  2043. local idleAnimRotZ = 0
  2044. local sneaking = 0
  2045.  
  2046. --local RS = game:GetService("RunService").RenderStepped
  2047. --local Player = Player
  2048. local Mouse = Player:GetMouse()
  2049.  
  2050. local oldHP = humanoid.Health
  2051. local damageTime = 0
  2052.  
  2053. local punchRotX = 0
  2054. local punchRotY = 0
  2055. local punchRotZ = 0
  2056. local punchRotXcam = 0
  2057. local punchRotYcam = 0
  2058. local punchRotZcam = 0
  2059. local punchSpeed = 0
  2060. local punching = 0
  2061. local selectedBlock = 8
  2062. local punchEnded = 1
  2063. local itemOnHand = nil
  2064.  
  2065. local selectBox = Instance.new("SelectionBox", char)
  2066. selectBox.Transparency = 0.5
  2067. selectBox.Color3 = Color3.new(0, 0, 0)
  2068. selectBox.LineThickness = 0
  2069.  
  2070. local handItem = Instance.new("Part", char)
  2071. handItem.Name = "HandItem"
  2072. handItem.Size = Vector3.new(0.52, 0.52, 0.52)
  2073. handItem.Transparency = 1
  2074. handItem.CanCollide = false
  2075.  
  2076. local handItemWeld = Instance.new("Weld", char)
  2077. handItemWeld.Part0 = handItem
  2078. handItemWeld.Part1 = lArm
  2079. handItemWeld.C1 = CFrame.new(0, -0.9, -0.6) * CFrame.Angles(math.rad(-10), math.rad(45), 0)
  2080.  
  2081. local sound = Instance.new("Sound", char)
  2082. sound.Name = "Hurt"
  2083. sound.Volume = 10
  2084. sound.SoundId = "rbxassetid://535690488"
  2085.  
  2086. local facesToResize = {"Front", "Back", "Left", "Right", "Bottom", "Top"}
  2087.  
  2088. local camCurrentZoom = (camera.CFrame.p - head.Position).magnitude
  2089. Mouse.Button1Down:connect(function()
  2090. if punchEnded == 1 then punching = 1 end
  2091. if Mouse.Target then
  2092. if getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  2093. local humanoid = Mouse.Target.Parent:FindFirstChild("Humanoid")
  2094. if humanoid then
  2095. humanoid.Health = humanoid.Health - 10
  2096. local parts = Mouse.Target.Parent:GetChildren()
  2097. for _,p in pairs(parts) do
  2098. if p.ClassName == "Part" then
  2099. 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))
  2100. end
  2101. end
  2102. return
  2103. end
  2104. local x = Mouse.Target.CFrame.p.X
  2105. local y = Mouse.Target.CFrame.p.Y
  2106. local z = Mouse.Target.CFrame.p.Z
  2107. if Mouse.TargetSurface.Name == "Right" then x = x + 2.6 end
  2108. if Mouse.TargetSurface.Name == "Left" then x = x - 2.6 end
  2109. if Mouse.TargetSurface.Name == "Top" then y = y + 2.6 end
  2110. if Mouse.TargetSurface.Name == "Bottom" then y = y - 2.6 end
  2111. if Mouse.TargetSurface.Name == "Back" then z = z + 2.6 end
  2112. if Mouse.TargetSurface.Name == "Front" then z = z - 2.6 end
  2113. if Mouse.Target.Size.X > 2.6 or Mouse.Target.Size.Y > 2.6 or Mouse.Target.Size.Z > 2.6 then
  2114. x = Mouse.Hit.p.X
  2115. y = Mouse.Hit.p.Y
  2116. z = Mouse.Hit.p.Z
  2117. end
  2118. -- local x = round(math.abs(mouseX)/2.6)*2.6
  2119. -- local y = round(math.abs(mouseY)/2.6)*2.6
  2120. -- local z = round(math.abs(mouseZ)/2.6)*2.6
  2121. -- if Mouse.Hit.p.X < 0 then x = x * -1 end
  2122. -- if Mouse.Hit.p.Y < 0 then y = y * -1 end
  2123. -- if Mouse.Hit.p.Z < 0 then z = z * -1 end
  2124. local blk = placeBlock(toolBar[selectedBlock + 1], CFrame.new(SnapToGrid(x, 2.6), SnapToGrid(y, 2.6), SnapToGrid(z, 2.6)), Mouse)
  2125. if blk then
  2126. for _,f in pairs(facesToResize) do
  2127. blk:WaitForChild(f).StudsPerTileU = 2.6
  2128. blk:WaitForChild(f).StudsPerTileV = 2.6
  2129. end
  2130. end
  2131. end
  2132. end
  2133. end)
  2134.  
  2135. local changedItem = false
  2136. local hasItemOnHand = 0
  2137. local hi = 0
  2138. -- selection thingy
  2139. local oldItemOnHand = itemOnHand
  2140. function updateItemOnHand()
  2141. for _,d in pairs(handItem:GetChildren()) do
  2142. d:Destroy()
  2143. end
  2144. if itemOnHand ~= nil then
  2145. putTexture(handItem, itemOnHand.frontTex, itemOnHand.backTex,
  2146. itemOnHand.topTex, itemOnHand.bottomTex,
  2147. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  2148.  
  2149. for _,f in pairs(facesToResize) do
  2150. handItem:WaitForChild(f).StudsPerTileU = 0.52
  2151. handItem:WaitForChild(f).StudsPerTileV = 0.52
  2152. end
  2153.  
  2154.  
  2155. else
  2156. end
  2157. if oldItemOnHand ~= itemOnHand then
  2158. changedItem = true
  2159. end
  2160. end
  2161.  
  2162. local pressedWTimes = 0
  2163. local sprintingNum = 0
  2164. local sprinting = false
  2165. Mouse.KeyDown:connect(function(key)
  2166. if sprinting == false then sprintingNum = 0 else sprintingNum = 1 end
  2167. if (key == "w" and sprinting == false and sneaking == 0) then
  2168. if pressedWTimes >= 1 or key == Enum.KeyCode.LeftControl then
  2169. sprinting = true
  2170. humanoid.WalkSpeed = humanoid.WalkSpeed * 1.5
  2171. pressedWTimes = 0
  2172. coroutine.resume(coroutine.create(function()
  2173. for i = 1, 24 do
  2174. camera.FieldOfView = camera.FieldOfView + ((24-i)/10)
  2175. RS:wait()
  2176. end
  2177. end))
  2178. end
  2179. pressedWTimes = pressedWTimes + 1
  2180. coroutine.resume(coroutine.create(function()
  2181. for i = 1, 9 do
  2182. if sprinting == true then break end
  2183. wait()
  2184. end
  2185. pressedWTimes = 0
  2186. end))
  2187. end
  2188. if key == "q" and sprinting == false then
  2189. sneaking = 1
  2190. humanoid.WalkSpeed = humanoid.WalkSpeed / 2
  2191. humanoid.HipHeight = humanoid.HipHeight - 0.35
  2192. rootJoint.C1 = CFrame.new(0, 0.325, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  2193. lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*45), 0, 0)
  2194. rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  2195. --print("Sneaking...")
  2196. end
  2197. if key == "1" or key == "2" or key == "3" or
  2198. key == "4" or key == "5" or key == "6" or
  2199. key == "7" or key == "8" or key == "9" then
  2200. selectedBlock = tonumber(key) - 1
  2201. oldItemOnHand = itemOnHand
  2202. itemOnHand = toolBar[tonumber(key)]
  2203. updateItemOnHand()
  2204. if hasItemOnHand == 0 and itemOnHand then hi = 1 end
  2205. if hasItemOnHand == 1 and itemOnHand == nil then hi = 1 end
  2206. end
  2207. --if (key == "0" or key == "1" or key == "2"
  2208. -- or key == "3" or key == "4" or key == "5"
  2209. -- or key == "6" or key == "7") and hasItemOnHand == 0 then hi = 1 end
  2210. --selectLabel.Position = UDim2.new(0.5, -160 + ((selectedBlock)*40), 1, -105)
  2211. end)
  2212.  
  2213. local interrump = false
  2214. game:GetService('RunService'):BindToRenderStep('Camera', Enum.RenderPriority.Camera.Value, function()
  2215. if humanoid.Health < oldHP then
  2216. interrump = true
  2217. RS:wait()
  2218. interrump = false
  2219. for i = 1, 15 do
  2220. if interrump == true then interrump = false break end
  2221. camera.CFrame = camera.CFrame * CFrame.Angles(0, 0, -math.rad(15-i))
  2222. RS:wait()
  2223. end
  2224. end
  2225. end)
  2226.  
  2227. local changedPerspective = 0
  2228. Mouse.KeyUp:connect(function(key)
  2229. if sprinting == false then sprintingNum = 0 else sprintingNum = 1 end
  2230. if (key == "w" and sprinting == true and sneaking == 0) then
  2231. sprinting = false
  2232. humanoid.WalkSpeed = humanoid.WalkSpeed / 1.5
  2233. coroutine.resume(coroutine.create(function()
  2234. for i = 1, 24 do
  2235. camera.FieldOfView = camera.FieldOfView - ((24-i)/10)
  2236. RS:wait()
  2237. end
  2238. end))
  2239. end
  2240. if key == "q" and sprinting == false then
  2241. sneaking = 0
  2242. humanoid.WalkSpeed = humanoid.WalkSpeed * 2
  2243. humanoid.HipHeight = humanoid.HipHeight + 0.35
  2244. rootJoint.C1 = CFrame.new(0, 0.05, 0) * CFrame.Angles(0, 0, 0)
  2245. lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(0, 0, 0)
  2246. rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(0, 0, 0)
  2247. --print("Stopped sneaking...")
  2248. end
  2249. if key == "r" then
  2250. if changedPerspective == 0 then
  2251. changedPerspective = 1
  2252. camera.CFrame = camera.CFrame * CFrame.Angles(0, math.rad(180), 0)
  2253. elseif changedPerspective == 1 then
  2254. changedPerspective = 0
  2255. camera.CFrame = camera.CFrame * CFrame.Angles(0, math.rad(-180), 0)
  2256. end
  2257. end
  2258. end)
  2259.  
  2260. Mouse.TargetFilter = camera
  2261.  
  2262. local dead = false
  2263. local humOffset = CFrame.new(0, 0, 0)
  2264. local camHandY = 0
  2265. local camHandZ = 0
  2266. --local cameraHandCFrame = CFrame.new(1.15, -1.35, -2) * CFrame.fromEulerAnglesXYZ(math.rad(90), math.rad(55), math.rad(20))
  2267. local bodyRot = CFrame.new(0, 0, 0)
  2268. local lastCamRot = camPart.Orientation
  2269. while RS:wait() do
  2270. --hearts.Size = UDim2.new(0, SnapToGrid((humanoid.Health/humanoid.MaxHealth)*162, 8) + 2, 0, 18)
  2271. camCurrentZoom = ((CFrame.new(0, -1*sneaking, 0) * camera.CFrame).p - head.Position).magnitude
  2272. if itemOnHand ~= nil then
  2273. hasItemOnHand = 1
  2274. handItem.Transparency = itemOnHand.transparency
  2275. else
  2276. hasItemOnHand = 0
  2277. handItem.Transparency = 1
  2278. end
  2279. if humanoid.Health <= 0 and dead == false then
  2280. dead = true
  2281. local corpseCF = humRootPart.CFrame + Vector3.new(0, -2.925, 0)
  2282. local corpse = Instance.new("Part", workspace)
  2283. corpse.Name = "Dead Corpse"
  2284. corpse.Size = Vector3.new(3, 1, 3)
  2285. corpse.CFrame = corpseCF
  2286. corpse.Transparency = 1
  2287. corpse.CustomPhysicalProperties = PhysicalProperties.new(1, 1, 0, 1, 1)
  2288.  
  2289. local dHead = Instance.new("Part", corpse)
  2290. dHead.CanCollide = false
  2291. dHead.Material = "Fabric"
  2292.  
  2293. local dTorso = Instance.new("Part", corpse)
  2294. dTorso.CanCollide = false
  2295. dTorso.Material = "Fabric"
  2296.  
  2297. local dLArm = Instance.new("Part", corpse)
  2298. dLArm.CanCollide = false
  2299. dLArm.Material = "Fabric"
  2300.  
  2301. local dRArm = Instance.new("Part", corpse)
  2302. dRArm.CanCollide = false
  2303. dRArm.Material = "Fabric"
  2304.  
  2305. local dLLeg = Instance.new("Part", corpse)
  2306. dLLeg.CanCollide = false
  2307. dLLeg.Material = "Fabric"
  2308.  
  2309. local dRLeg = Instance.new("Part", corpse)
  2310. dRLeg.CanCollide = false
  2311. dRLeg.Material = "Fabric"
  2312.  
  2313. dHead.Size = Vector3.new(1.3, 1.3, 1.3)
  2314. putTexture(dHead, "rbxassetid://38738031", "rbxassetid://36047330",
  2315. "rbxassetid://36047341", "rbxassetid://36047347",
  2316. "rbxassetid://36047323", "rbxassetid://36047315", "Decal")
  2317.  
  2318. dTorso.Size = Vector3.new(1.3, 1.95, 0.65)
  2319. putTexture(dTorso, "rbxassetid://38934753", "rbxassetid://38934731",
  2320. "rbxassetid://38934780", "rbxassetid://38934740",
  2321. "rbxassetid://38934762", "rbxassetid://38934762", "Decal")
  2322.  
  2323. dLArm.Size = Vector3.new(0.65, 1.95, 0.65)
  2324. putTexture(dLArm, "rbxassetid://38934581", "rbxassetid://38934560",
  2325. "rbxassetid://38934613", "rbxassetid://38934568",
  2326. "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
  2327.  
  2328. dRArm.Size = Vector3.new(0.65, 1.95, 0.65)
  2329. putTexture(dRArm, "rbxassetid://38934560", "rbxassetid://38934581",
  2330. "rbxassetid://38934613", "rbxassetid://38934568",
  2331. "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
  2332.  
  2333. dLLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  2334. putTexture(dLLeg, "rbxassetid://38936226", "rbxassetid://38936209",
  2335. "rbxassetid://38934719", "rbxassetid://38934712",
  2336. "rbxassetid://38936255", "rbxassetid://38936242", "Decal")
  2337.  
  2338. dRLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  2339. putTexture(dRLeg, "rbxassetid://38936209", "rbxassetid://38936226",
  2340. "rbxassetid://38934719", "rbxassetid://38934712",
  2341. "rbxassetid://38936242", "rbxassetid://38936255", "Decal")
  2342.  
  2343. local weldCorpse = weldTo(dTorso, corpse)
  2344. weldCorpse.C0 = CFrame.new(0, -1.95 - 0.4, 0)
  2345.  
  2346. -- lazy naming...
  2347.  
  2348. local weld1 = weldTo(dTorso, dHead)
  2349. weld1.C0 = CFrame.new(0, 1.625, 0)
  2350.  
  2351. local weld2 = weldTo(dTorso, dLArm)
  2352. weld2.C0 = CFrame.new(0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  2353. weld2.C1 = CFrame.new(-0.65, 0.975, 0)
  2354.  
  2355. local weld3 = weldTo(dTorso, dRArm)
  2356. weld3.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  2357. weld3.C1 = CFrame.new(-0.65, 0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  2358.  
  2359. local weld4 = weldTo(dTorso, dLLeg)
  2360. weld4.C0 = CFrame.new(0, -0.975, 0)
  2361. weld4.C1 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  2362.  
  2363. local weld5 = weldTo(dTorso, dRLeg)
  2364. weld5.C0 = CFrame.new(0, -0.975, 0)
  2365. weld5.C1 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  2366.  
  2367. for _,p in pairs(corpse:GetChildren()) do
  2368. if p.ClassName == "Part" then
  2369. local hit = Instance.new("Part", p)
  2370. hit.Name = "DamagePart"
  2371. hit.BrickColor = BrickColor.new("Bright red")
  2372. hit.Material = "SmoothPlastic"
  2373. hit.Transparency = 0.5
  2374. hit.Size = Vector3.new(p.Size.X + 0.05, p.Size.Y + 0.05, p.Size.Z + 0.05)
  2375. hit.CanCollide = false
  2376. weldTo(hit, p)
  2377. end
  2378. end
  2379.  
  2380. head.Parent = nil
  2381. torso.Parent = nil
  2382. lArm.Parent = nil
  2383. rArm.Parent = nil
  2384. lLeg.Parent = nil
  2385. rLeg.Parent = nil
  2386.  
  2387. weldTo(dTorso, humRootPart)
  2388.  
  2389. coroutine.resume(coroutine.create(function()
  2390. for i = 1, 55 do
  2391. corpse.CFrame = corpseCF --*
  2392. --CFrame.Angles(math.rad(-corpse.Orientation.X), 0, math.rad(-corpse.Orientation.Z))
  2393.  
  2394. weldCorpse.C1 = weldCorpse.C1:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, math.rad(90)), 0.075)
  2395. RS:wait()
  2396. end
  2397. for _,p in pairs(corpse:GetChildren()) do
  2398. p:Destroy()
  2399. end
  2400.  
  2401. corpse.Anchored = true
  2402.  
  2403. local smoke = Instance.new("ParticleEmitter", corpse)
  2404. smoke.Size = NumberSequence.new({
  2405. NumberSequenceKeypoint.new(0, 0.6),
  2406. NumberSequenceKeypoint.new(1, 0.6)
  2407. })
  2408. smoke.Texture = "rbxassetid://1494734425"
  2409. smoke.Rate = 100
  2410. smoke.Lifetime = NumberRange.new(0.6, 1.2)
  2411. smoke.Speed = NumberRange.new(2, 5)
  2412. smoke.SpreadAngle = Vector2.new(-30, 30)
  2413.  
  2414. wait(0.07)
  2415.  
  2416. smoke.Enabled = false
  2417.  
  2418. wait(2)
  2419.  
  2420. corpse:Destroy()
  2421. end))
  2422. print("You died!")
  2423. end
  2424. if humanoid.Health < oldHP then
  2425. damageTime = 60
  2426. sound:Play()
  2427. end
  2428. oldHP = humanoid.Health
  2429. if damageTime > 0 and humanoid.Health > 0 then
  2430. for _,p in pairs(char:GetChildren()) do
  2431. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  2432. if p.Name == "DamagePart" then
  2433. p.Transparency = 0.5
  2434. end
  2435. end
  2436. end
  2437. damageTime = damageTime - 2
  2438. if damageTime <= 0 then
  2439. for _,p in pairs(char:GetChildren()) do
  2440. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  2441. if p.Name == "DamagePart" then
  2442. p.Transparency = 1
  2443. end
  2444. end
  2445. end
  2446. end
  2447. end
  2448. camPart.CFrame = camera.CFrame * CFrame.Angles(0, math.rad(changedPerspective*180), 0)
  2449.  
  2450. if getMagnitudeXZ(torso.Velocity) > 1 then
  2451. if walkAnim >= 1 then
  2452. increaseWalkAnim = -1
  2453. elseif walkAnim <= -1 then
  2454. increaseWalkAnim = 1
  2455. end
  2456. walkAnim = walkAnim + (increaseWalkAnim/(10+(sneaking*20))) * ((5 + getMagnitudeXZ(torso.Velocity))/20)
  2457. else
  2458. walkAnim = 0
  2459. end
  2460.  
  2461. --lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*45), 0, 0)
  2462. --rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  2463. 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)
  2464. 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)
  2465. --
  2466. --rootJoint.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  2467. --print(math.abs(head.Orientation.Y) - math.abs(humRootPart.Orientation.Y))
  2468. --if (head.Orientation.Y * 2) - (head.Orientation.Y + torso.Orientation.Y) > 45 then
  2469. --humRootPart.CFrame = humRootPart.CFrame * CFrame.Angles(0, math.rad(-45 + head.Orientation.Y), 0)
  2470. --print("-45")
  2471. --end
  2472. --if (head.Orientation.Y * 2) - (head.Orientation.Y + torso.Orientation.Y) < -45 then
  2473. --humRootPart.CFrame = humRootPart.CFrame * CFrame.Angles(0, math.rad(45 + head.Orientation.Y), 0)
  2474. --print("45")
  2475. --end
  2476.  
  2477. if changedItem then
  2478. changedItem = false
  2479. coroutine.resume(coroutine.create(function()
  2480. for i = 1, 8 do
  2481. camHandY = camHandY - 0.2
  2482. RS:wait()
  2483. end
  2484. for i = 1, 8 do
  2485. camHandY = camHandY + 0.2
  2486. RS:wait()
  2487. end
  2488. end))
  2489. end
  2490.  
  2491. --move these arms
  2492. rootJoint.C1 = rootJoint.C1:lerp(CFrame.new(0, 0.325, 0) * CFrame.Angles(math.rad(sneaking*45), math.rad(punchRotY), 0), 0.2)
  2493.  
  2494. 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)
  2495. 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)
  2496.  
  2497. if Mouse.Target and getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  2498. if Mouse.Target.Parent:FindFirstChild("Humanoid") == nil and Mouse.Target.Parent ~= camera then
  2499. selectBox.Adornee = Mouse.Target
  2500. else
  2501. selectBox.Adornee = nil
  2502. end
  2503. else
  2504. selectBox.Adornee = nil
  2505. end
  2506.  
  2507. --local neckYRot = math.rad(camPart.Orientation.Y - torso.Orientation.Y)
  2508.  
  2509. --neck.C1 = CFrame.new(0, 0.975, 0) * CFrame.fromEulerAnglesXYZ(math.rad(sneaking*45), neckYRot, 0)
  2510. --neck.C0 = CFrame.new(0, -0.65, 0) * CFrame.Angles(-math.rad(camPart.Orientation.X - torso.Orientation.X - (sneaking*45)), 0, 0)
  2511.  
  2512. --print(AngleDifference(camPart.Orientation, torso.Orientation).Y)
  2513.  
  2514. local negate = 1
  2515. if torso.Velocity.Y < 0 then
  2516. negate = -1
  2517. end
  2518.  
  2519. --local vel = math.log(math.abs(torso.Velocity.Y))*negate
  2520. --if vel == math.huge or vel == -math.huge then vel = 0.1 end
  2521. --local vel = torso.Velocity.Y^0.6
  2522.  
  2523. local BobbingY = walkAnim*2
  2524. if BobbingY >= 1 then BobbingY = 1 BobbingY = -BobbingY end
  2525.  
  2526. local rotationSpeed = AngleDifference(camPart.Orientation, lastCamRot)
  2527.  
  2528. local BobbingX = -0.5 + walkAnim
  2529.  
  2530. --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)
  2531. --cameraHandCFrame = cameraHandCFrame:lerp(CFrame.Angles(math.rad(rotationSpeed.X/1.5), math.rad(rotationSpeed.Y/1.5), math.rad(rotationSpeed.Z/1.5)) * 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)
  2532.  
  2533. humOffset = humOffset:lerp(CFrame.new(walkAnim/4 - (walkAnim/8), BobbingY/13, 0), 0.25)
  2534. humanoid.CameraOffset = Vector3.new(humOffset.X, humOffset.Y, 0)
  2535.  
  2536.  
  2537. if updateHand == true then
  2538. updateHand = false
  2539. updateItemOnHand()
  2540. end
  2541.  
  2542. if punching == 1 and punchEnded == 1 then
  2543. punching = 0
  2544. --print("steve uses punch!!")
  2545. local coPunchCam = coroutine.wrap(function()
  2546. local mult = 2.25
  2547. punchRotXcam = 40/2*mult
  2548. punchRotYcam = 25/2*mult
  2549. camHandZ = 2.5
  2550. wait(0.075/4)
  2551. punchRotXcam = 50/2*mult
  2552. punchRotYcam = 25*mult
  2553. punchRotZcam = -10*mult
  2554. camHandZ = 1
  2555. wait(0.075/4)
  2556. punchRotYcam = 50/1.5*mult
  2557. punchRotXcam = -10*mult
  2558. --wait(0.075/2)
  2559. --punchRotYcam = 50
  2560. --punchRotXcam = -10
  2561. wait(0.02)
  2562. punchRotXcam = -20*mult
  2563. wait(0.055)
  2564. camHandZ = 0
  2565. punchRotXcam = 0
  2566. punchRotYcam = 0
  2567. punchRotZcam = 0
  2568. end)
  2569. local coPunch = coroutine.wrap(function()
  2570. punchEnded = 0
  2571. punchSpeed = 1
  2572. punchRotX = -60
  2573. punchRotY = -8
  2574. punchRotZ = -35
  2575.  
  2576. wait(0.075/1.3)
  2577. punchSpeed = 1
  2578. punchRotX = -75
  2579. punchRotY = 8
  2580. punchRotZ = 40
  2581. wait(0.075/1.3)
  2582. punchSpeed = 1
  2583. punchRotX = -20
  2584. punchRotZ = 40
  2585. wait(0.075/1.3)
  2586. punchSpeed = 3.5
  2587. punchRotX = 0
  2588. punchRotY = 0
  2589. punchRotZ = 0
  2590.  
  2591. punchRotXcam = 0
  2592. punchRotYcam = 0
  2593. punchRotZcam = 0
  2594.  
  2595. punchEnded = 1
  2596. wait(0.06/1.3)
  2597. punchSpeed = 0
  2598. end)
  2599. coPunch()
  2600. coPunchCam()
  2601. end
  2602. if ticks > 20 then
  2603. ticks = 0
  2604. if times == 0 then
  2605. times = times + 1
  2606. idleAnimRotX = -1
  2607. idleAnimRotZ = 0
  2608. elseif times == 1 then
  2609. times = times + 1
  2610. idleAnimRotX = -0.75
  2611. idleAnimRotZ = -0.75
  2612. elseif times == 2 then
  2613. times = times + 1
  2614. idleAnimRotX = 0
  2615. idleAnimRotZ = -1
  2616. elseif times == 3 then
  2617. times = times + 1
  2618. idleAnimRotX = 0.75
  2619. idleAnimRotZ = -0.75
  2620. --idleAnimRotX = 0.75
  2621. --idleAnimRotZ = -0
  2622. elseif times == 4 then
  2623. times = times + 1
  2624. idleAnimRotX = 1
  2625. idleAnimRotZ = 0
  2626. --idleAnimRotX = 1
  2627. --idleAnimRotZ = 0
  2628. elseif times == 5 then
  2629. times = times + 1
  2630. idleAnimRotX = 0.75
  2631. idleAnimRotZ = 0.75
  2632. elseif times == 6 then
  2633. times = times + 1
  2634. idleAnimRotX = 0
  2635. idleAnimRotZ = 1
  2636. elseif times == 7 then
  2637. times = 0
  2638. idleAnimRotX = -0.75
  2639. idleAnimRotZ = 0.75
  2640. end
  2641. end
  2642.  
  2643. if hi == 1 then hi = 0 end
  2644.  
  2645. end
  2646. end
Add Comment
Please, Sign In to add comment