Advertisement
TheBite

steve

Aug 19th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.89 KB | None | 0 0
  1. -- ORIGINAL CREATOR: Depr1
  2. --Fixed lags by stommmDev for toasters if the creator wants to shut down this script i will
  3. -- If this script isn't on pastebin or the user who uploaded this isn't called "Delros12"
  4. -- (and yes my pastebin account is Delros12) or the link is not https://pastebin.com/2NNDTLjL
  5. -- then this is not the original link of this script.
  6.  
  7. -- The original link of the script gets edited constantly for updates, if you use the original
  8. -- link you will be able to enjoy the most recent updates of this script without changing to
  9. -- another link which contains updated script.
  10.  
  11. -- Enjoy! :)
  12.  
  13. -- Controls: Q to sneak, use the keypad numbers 1-9 to change blocks, choose a empty slot i
  14. -- you want to remove a block.
  15.  
  16. -- this script will transform you into steve when used
  17.  
  18. -- This script has been converted to FE by BITEblox
  19.  
  20.  
  21. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  22. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  23. do
  24. print("FE Compatibility code by Mokiros | Translated to FE by BITEblox")
  25. script.Parent = Player.Character
  26.  
  27. --RemoteEvent for communicating
  28. local Event = Instance.new("RemoteEvent")
  29. Event.Name = "UserInput_Event"
  30.  
  31. --Fake event to make stuff like Mouse.KeyDown work
  32. local function fakeEvent()
  33. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  34. t.connect = t.Connect
  35. return t
  36. end
  37.  
  38. --Creating fake input objects with fake variables
  39. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  40. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  41. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  42. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  43. end}
  44. --Merged 2 functions into one by checking amount of arguments
  45. CAS.UnbindAction = CAS.BindAction
  46.  
  47. --This function will trigger the events that have been :Connect()'ed
  48. local function te(self,ev,...)
  49. local t = m[ev]
  50. if t and t._fakeEvent and t.Function then
  51. t.Function(...)
  52. end
  53. end
  54. m.TrigEvent = te
  55. UIS.TrigEvent = te
  56.  
  57. Event.OnServerEvent:Connect(function(plr,io)
  58. if plr~=Player then return end
  59. if io.isMouse then
  60. m.Target = io.Target
  61. m.Hit = io.Hit
  62. else
  63. local b = io.UserInputState == Enum.UserInputState.Begin
  64. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  65. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  66. end
  67. for _,t in pairs(CAS.Actions) do
  68. for _,k in pairs(t.Keys) do
  69. if k==io.KeyCode then
  70. t.Function(t.Name,io.UserInputState,io)
  71. end
  72. end
  73. end
  74. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  75. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  76. end
  77. end)
  78. Event.Parent = NLS([==[
  79. local Player = owner
  80. local Event = script:WaitForChild("UserInput_Event")
  81.  
  82. local UIS = game:GetService("UserInputService")
  83. local input = function(io,a)
  84. if a then return end
  85. --Since InputObject is a client-side instance, we create and pass table instead
  86. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  87. end
  88. UIS.InputBegan:Connect(input)
  89. UIS.InputEnded:Connect(input)
  90.  
  91. local h,t
  92. --Give the server mouse data 30 times every second, but only if the values changed
  93. --If player is not moving their mouse, client won't fire events
  94. while wait(1/30) do
  95. if h~=Mouse.Hit or t~=Mouse.Target then
  96. h,t=Mouse.Hit,Mouse.Target
  97. Event:FireServer({isMouse=true,Target=t,Hit=h})
  98. end
  99. end]==],Player.Character)
  100. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  101. end
  102.  
  103. local targetName = game.Players.LocalPlayer.Name
  104. local player = owner
  105. function putTexture(part, frontF, backF, topF, bottomF, leftF, rightF, className)
  106. local faces = {"Front", "Back", "Top", "Bottom", "Left", "Right"}
  107. for i,f in pairs(faces) do
  108. local decal = Instance.new(className, part)
  109. if i == 1 then decal.Texture = frontF decal.Name = f end
  110. if i == 2 then decal.Texture = backF or frontF decal.Name = f end
  111. if i == 3 then decal.Texture = topF or frontF decal.Name = f end
  112. if i == 4 then decal.Texture = bottomF or frontF decal.Name = f end
  113. if i == 5 then decal.Texture = leftF or frontF decal.Name = f end
  114. if i == 6 then decal.Texture = rightF or frontF decal.Name = f end
  115. decal.Face = f
  116. end
  117. return part
  118. end
  119. function makeSquare(position, size, color, transparency, parent)
  120. local label = Instance.new("TextLabel", parent)
  121. label.Text = ""
  122. label.BorderSizePixel = 0
  123. label.BackgroundTransparency = transparency
  124. label.Position = position
  125. label.Size = size
  126. label.BackgroundColor3 = color
  127. end
  128. function putToolBarSlot(position, image)
  129. local playerGui = player:FindFirstChild("PlayerGui")
  130. if playerGui then
  131. local gui = playerGui:FindFirstChild("ToolBar") or Instance.new("ScreenGui", playerGui)
  132. gui.Name = "ToolBar"
  133. local slot = Instance.new("ImageLabel", gui)
  134. slot.Position = position
  135. slot.Size = UDim2.new(0, 32, 0, 32)
  136. slot.BackgroundTransparency = 1
  137. slot.ImageTransparency = 0
  138. slot.Image = image
  139. slot.ZIndex = 2
  140.  
  141. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 32, 0, 32),
  142. Color3.new(95/255, 89/255, 76/255), 0, slot)
  143. makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 2, 0, 32),
  144. Color3.new(0/255, 0/255, 0/255), 0.5, slot)
  145. makeSquare(UDim2.new(0, 2, 0, 0), UDim2.new(0, 30, 0, 2),
  146. Color3.new(0/255, 0/255, 0/255), 0.5, slot)
  147. makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 36, 0, 2),
  148. Color3.new(106/255, 106/255, 106/255), 0, slot)
  149. makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 2, 0, 36),
  150. Color3.new(106/255, 106/255, 106/255), 0, slot)
  151. makeSquare(UDim2.new(0, 0, 0, 32), UDim2.new(0, 34, 0, 2),
  152. Color3.new(130/255, 130/255, 130/255), 0, slot)
  153. makeSquare(UDim2.new(0, 32, 0, 0), UDim2.new(0, 2, 0, 34),
  154. Color3.new(130/255, 130/255, 130/255), 0, slot)
  155. makeSquare(UDim2.new(0, -4, 0, -2), UDim2.new(0, 2, 0, 38),
  156. Color3.new(130/255, 130/255, 130/255), 0, slot)
  157. makeSquare(UDim2.new(0, 34, 0, -2), UDim2.new(0, 2, 0, 36),
  158. Color3.new(106/255, 106/255, 106/255), 0, slot)
  159. makeSquare(UDim2.new(0, -2, 0, 34), UDim2.new(0, 38, 0, 2),
  160. Color3.new(106/255, 106/255, 106/255), 0, slot)
  161. makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 40, 0, 2),
  162. Color3.new(156/255, 156/255, 156/255), 0, slot)
  163. end
  164. end
  165. function divide(x, d)
  166. if x ~= 0 and d ~= 0 then
  167. return x/d
  168. else
  169. return x
  170. end
  171. end -- so it doesn't divide by zero
  172. function getDistance(v1, v2)
  173. return math.abs((Vector3.new(math.abs(v2.X - v1.X), math.abs(v2.Y - v1.Y), math.abs(v2.Z - v1.Z))).Magnitude)
  174. end
  175. function round(x)
  176. if x%2 ~= 0.5 then
  177. return math.floor(x+0.5)
  178. end
  179. return x-0.5
  180. end
  181. function weldTo(part1, part2)
  182. local weld = Instance.new("Weld", part1)
  183. weld.Part0 = part1
  184. weld.Part1 = part2
  185. end
  186. function getMagnitudeXZ(velocity)
  187. return math.abs(velocity.X) + math.abs(velocity.Z)
  188. end
  189. function placeBlock(block, cFPos)
  190. local blockPlaced = Instance.new("Part", workspace)
  191. blockPlaced.Material = "Fabric"
  192. blockPlaced.Anchored = true
  193. blockPlaced.Size = block.size
  194. blockPlaced.CFrame = cFPos
  195. putTexture(blockPlaced, block.frontTex, block.backTex,
  196. block.topTex, block.bottomTex, block.leftTex, block.rightTex, "Texture")
  197. return blockPlaced
  198. end
  199. local toolBar = {
  200. Dirt = {
  201. size = Vector3.new(2.6, 2.6, 2.6),
  202. frontTex = "rbxassetid://179655033",
  203. backTex = "rbxassetid://179655033",
  204. topTex = "rbxassetid://179655033",
  205. bottomTex = "rbxassetid://179655033",
  206. leftTex = "rbxassetid://179655033",
  207. rightTex = "rbxassetid://179655033"
  208. },
  209. Grass = {
  210. size = Vector3.new(2.6, 2.6, 2.6),
  211. frontTex = "rbxassetid://96430337",
  212. backTex = "rbxassetid://96430337",
  213. topTex = "rbxassetid://96430265",
  214. bottomTex = "rbxassetid://179655033",
  215. leftTex = "rbxassetid://96430337",
  216. rightTex = "rbxassetid://96430337"
  217. },
  218. Stone = {
  219. size = Vector3.new(2.6, 2.6, 2.6),
  220. frontTex = "rbxassetid://75880927",
  221. backTex = "rbxassetid://75880927",
  222. topTex = "rbxassetid://75880927",
  223. bottomTex = "rbxassetid://75880927",
  224. leftTex = "rbxassetid://75880927",
  225. rightTex = "rbxassetid://75880927"
  226. },
  227. Diamond_Ore = {
  228. size = Vector3.new(2.6, 2.6, 2.6),
  229. frontTex = "rbxassetid://57928490",
  230. backTex = "rbxassetid://57928490",
  231. topTex = "rbxassetid://57928490",
  232. bottomTex = "rbxassetid://57928490",
  233. leftTex = "rbxassetid://57928490",
  234. rightTex = "rbxassetid://57928490"
  235. },
  236. Diamond_Block = {
  237. size = Vector3.new(2.6, 2.6, 2.6),
  238. frontTex = "rbxassetid://56749955",
  239. backTex = "rbxassetid://56749955",
  240. topTex = "rbxassetid://56749955",
  241. bottomTex = "rbxassetid://56749955",
  242. leftTex = "rbxassetid://56749955",
  243. rightTex = "rbxassetid://56749955"
  244. },
  245. Wood_Planks = {
  246. size = Vector3.new(2.6, 2.6, 2.6),
  247. frontTex = "rbxassetid://346201871",
  248. backTex = "rbxassetid://346201871",
  249. topTex = "rbxassetid://346201871",
  250. bottomTex = "rbxassetid://346201871",
  251. leftTex = "rbxassetid://346201871",
  252. rightTex = "rbxassetid://346201871"
  253. },
  254. Oak_Log = {
  255. size = Vector3.new(2.6, 2.6, 2.6),
  256. frontTex = "rbxassetid://310831812",
  257. backTex = "rbxassetid://310831812",
  258. topTex = "rbxassetid://152538557",
  259. bottomTex = "rbxassetid://152538557",
  260. leftTex = "rbxassetid://310831812",
  261. rightTex = "rbxassetid://310831812"
  262. }
  263. }
  264. if player then
  265. local char = player.Character
  266. if char then
  267. for _,cM in pairs(char:GetChildren()) do
  268. if cM.ClassName == "CharacterMesh" then cM:Destroy() end
  269. end
  270.  
  271. --[]
  272. local gui = player.PlayerGui:FindFirstChild("ToolBar") or Instance.new("ScreenGui", player.PlayerGui)
  273. gui.Name = "ToolBar"
  274.  
  275. makeSquare(UDim2.new(0.5, -166, 1, -111), UDim2.new(0, 364, 0, 44),
  276. Color3.new(0/255, 0/255, 0/255), 0, gui)
  277.  
  278. local blocks = {"Dirt", "Grass", "Stone", "Diamond_Ore", "Diamond_Block", "Wood_Planks", "Oak_Log"}
  279. for i = 1, 9 do
  280. if toolBar[blocks[i]] ~= nil then
  281. putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), toolBar[blocks[i]].frontTex)
  282. else
  283. putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), "")
  284. end
  285. end
  286.  
  287. local humRootPart = char:WaitForChild("HumanoidRootPart")
  288. local head = char:WaitForChild("Head")
  289. local torso = char:WaitForChild("Torso")
  290. local lArm = char:WaitForChild("Left Arm")
  291. local rArm = char:WaitForChild("Right Arm")
  292. local lLeg = char:WaitForChild("Left Leg")
  293. local rLeg = char:WaitForChild("Right Leg")
  294.  
  295. head.Size = Vector3.new(1.3, 1.3, 1.3)
  296. putTexture(head, "rbxassetid://38738031", "rbxassetid://36047330",
  297. "rbxassetid://36047341", "rbxassetid://36047347",
  298. "rbxassetid://36047323", "rbxassetid://36047315", "Decal")
  299. head:WaitForChild("Mesh"):Destroy()
  300. head:WaitForChild("face"):Destroy()
  301.  
  302. torso.Size = Vector3.new(1.3, 1.95, 0.65)
  303. putTexture(torso, "rbxassetid://38934753", "rbxassetid://38934731",
  304. "rbxassetid://38934780", "rbxassetid://38934740",
  305. "rbxassetid://38934762", "rbxassetid://38934762", "Decal")
  306.  
  307. lArm.Size = Vector3.new(0.65, 1.95, 0.65)
  308. putTexture(lArm, "rbxassetid://38934581", "rbxassetid://38934560",
  309. "rbxassetid://38934613", "rbxassetid://38934568",
  310. "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
  311.  
  312. rArm.Size = Vector3.new(0.65, 1.95, 0.65)
  313. putTexture(rArm, "rbxassetid://38934560", "rbxassetid://38934581",
  314. "rbxassetid://38934613", "rbxassetid://38934568",
  315. "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
  316.  
  317. lLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  318. putTexture(lLeg, "rbxassetid://38936226", "rbxassetid://38936209",
  319. "rbxassetid://38934719", "rbxassetid://38934712",
  320. "rbxassetid://38936255", "rbxassetid://38936242", "Decal")
  321.  
  322. rLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  323. putTexture(rLeg, "rbxassetid://38936209", "rbxassetid://38936226",
  324. "rbxassetid://38934719", "rbxassetid://38934712",
  325. "rbxassetid://38936242", "rbxassetid://38936255", "Decal")
  326.  
  327. char.Humanoid:ClearAllChildren()
  328. char.Animate:Remove()
  329.  
  330. -- now for the real stuff
  331. -- |
  332. -- |
  333. -- V
  334. Instance.new("BlockMesh", torso)
  335. Instance.new("BlockMesh", lArm)
  336. Instance.new("BlockMesh", rArm)
  337. Instance.new("BlockMesh", lLeg)
  338. Instance.new("BlockMesh", rLeg)
  339.  
  340. local camera = workspace.Camera
  341. local camPart = Instance.new("Part", camera)
  342. camPart.Size = Vector3.new(0, 0, 0)
  343. camPart.CFrame = camera.CFrame
  344. camPart.Transparency = 1
  345.  
  346. --[[local cameraHand = Instance.new("Part", camera)
  347. cameraHand.Size = Vector3.new(0.65, 1.95, 0.65)
  348. cameraHand.CanCollide = false
  349. cameraHand.Anchored = true
  350. cameraHand.Name = "CameraHand"
  351. putTexture(cameraHand, "rbxassetid://38934560", "rbxassetid://38934581",
  352. "rbxassetid://38934613", "rbxassetid://38934568",
  353. "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
  354.  
  355. local cameraHandWeld = Instance.new("Motor6D", camPart)
  356. cameraHandWeld.Part0 = camPart
  357. cameraHandWeld.Part1 = cameraHand
  358. cameraHandWeld.C0 = CFrame.new(5, 0, 0)
  359. ]]--
  360.  
  361. local humanoid = char:WaitForChild("Humanoid")
  362. humanoid.HipHeight = 0.3
  363.  
  364. local rootJoint = Instance.new("Motor6D", torso)
  365. rootJoint.Name = "RootJoint"
  366. rootJoint.Part0 = humRootPart
  367. rootJoint.Part1 = torso
  368. rootJoint.C1 = CFrame.new(0, 0.05, 0)
  369.  
  370. local neck = Instance.new("Motor6D", torso)
  371. neck.Name = "Neck"
  372. neck.Part0 = head
  373. neck.Part1 = torso
  374.  
  375. local lS = Instance.new("Motor6D", torso)
  376. lS.Name = "Left Shoulder"
  377. lS.Part0 = lArm
  378. lS.Part1 = torso
  379. lS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  380. lS.C1 = CFrame.new(0.65, 0.975, 0)
  381.  
  382. local rS = Instance.new("Motor6D", torso)
  383. rS.Name = "Right Shoulder"
  384. rS.Part0 = rArm
  385. rS.Part1 = torso
  386. rS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  387. rS.C1 = CFrame.new(-0.65, 0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  388.  
  389. local lH = Instance.new("Motor6D", torso)
  390. lH.Name = "Left Hip"
  391. lH.Part0 = lLeg
  392. lH.Part1 = torso
  393. lH.C0 = CFrame.new(0, 0.975, 0)
  394. lH.C1 = CFrame.new(0.325, -0.975, 0) * CFrame.Angles(0, 0, 0)
  395.  
  396. local rH = Instance.new("Motor6D", torso)
  397. rH.Name = "Right Hip"
  398. rH.Part0 = rLeg
  399. rH.Part1 = torso
  400. rH.C0 = CFrame.new(0, 0.975, 0)
  401. rH.C1 = CFrame.new(-0.325, -0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  402.  
  403. for _,p in pairs(char:GetChildren()) do
  404. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  405. local hit = Instance.new("Part", char)
  406. hit.Name = "DamagePart"
  407. hit.BrickColor = BrickColor.new("Bright red")
  408. hit.Material = "SmoothPlastic"
  409. hit.Transparency = 1
  410. hit.Size = Vector3.new(p.Size.X + 0.05, p.Size.Y + 0.05, p.Size.Z + 0.05)
  411. hit.CanCollide = false
  412. weldTo(hit, p)
  413. end
  414. end
  415.  
  416. local ticks = 0
  417. local times = 0
  418.  
  419. local walkAnim = 0
  420. local increaseWalkAnim = 1
  421.  
  422. local idleAnimRotX = 0
  423. local idleAnimRotZ = 0
  424. local sneaking = 0
  425.  
  426. local RS = game:GetService("RunService").RenderStepped
  427.  
  428. local oldHP = humanoid.Health
  429. local damageTime = 0
  430.  
  431. local punchRotX = 0
  432. local punchRotY = 0
  433. local punchRotZ = 0
  434. local punchSpeed = 0
  435. local punching = 0
  436. local selectedBlock = 8
  437. local punchEnded = 1
  438. local itemOnHand = nil
  439.  
  440. local handItem = Instance.new("Part", char)
  441. handItem.Name = "HandItem"
  442. handItem.Size = Vector3.new(0.52, 0.52, 0.52)
  443. handItem.Transparency = 1
  444. handItem.CanCollide = false
  445.  
  446. local handItemWeld = Instance.new("Weld", char)
  447. handItemWeld.Part0 = handItem
  448. handItemWeld.Part1 = lArm
  449. handItemWeld.C1 = CFrame.new(0, -0.9, -0.6) * CFrame.Angles(math.rad(-10), math.rad(45), 0)
  450.  
  451. local sound = Instance.new("Sound", char)
  452. sound.Name = "Hurt"
  453. sound.Volume = 10
  454. sound.SoundId = "rbxassetid://535690488"
  455.  
  456. local facesToResize = {"Front", "Back", "Left", "Right", "Bottom", "Top"}
  457. Mouse.Button1Down:connect(function()
  458. if punchEnded == 1 then punching = 1 end
  459. if Mouse.Target then
  460. if getDistance(head.CFrame.p, Mouse.Hit.p) <= 10.4 then
  461. local humanoid = Mouse.Target.Parent:FindFirstChild("Humanoid")
  462. if humanoid then
  463. humanoid.Health = humanoid.Health - 10
  464. local parts = Mouse.Target.Parent:GetChildren()
  465. for _,p in pairs(parts) do
  466. if p.ClassName == "Part" then
  467. 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))
  468. end
  469. end
  470. return
  471. end
  472. local x = Mouse.Target.CFrame.p.X
  473. local y = Mouse.Target.CFrame.p.Y
  474. local z = Mouse.Target.CFrame.p.Z
  475. if Mouse.TargetSurface.Name == "Right" then x = x + 2.6 end
  476. if Mouse.TargetSurface.Name == "Left" then x = x - 2.6 end
  477. if Mouse.TargetSurface.Name == "Top" then y = y + 2.6 end
  478. if Mouse.TargetSurface.Name == "Bottom" then y = y - 2.6 end
  479. if Mouse.TargetSurface.Name == "Back" then z = z + 2.6 end
  480. if Mouse.TargetSurface.Name == "Front" then z = z - 2.6 end
  481. if Mouse.Target.Size.X > 2.6 or Mouse.Target.Size.Y > 2.6 or Mouse.Target.Size.Z > 2.6 then
  482. x = Mouse.Hit.p.X
  483. y = Mouse.Hit.p.Y
  484. z = Mouse.Hit.p.Z
  485. end
  486. -- local x = round(math.abs(mouseX)/2.6)*2.6
  487. -- local y = round(math.abs(mouseY)/2.6)*2.6
  488. -- local z = round(math.abs(mouseZ)/2.6)*2.6
  489. -- if Mouse.Hit.p.X < 0 then x = x * -1 end
  490. -- if Mouse.Hit.p.Y < 0 then y = y * -1 end
  491. -- if Mouse.Hit.p.Z < 0 then z = z * -1 end
  492. if selectedBlock == 0 then
  493. local blk = placeBlock(toolBar.Dirt, CFrame.new(x, y, z))
  494. for _,f in pairs(facesToResize) do
  495. blk:WaitForChild(f).StudsPerTileU = 2.6
  496. blk:WaitForChild(f).StudsPerTileV = 2.6
  497. end
  498. elseif selectedBlock == 1 then
  499. local blk = placeBlock(toolBar.Grass, CFrame.new(x, y, z))
  500. for _,f in pairs(facesToResize) do
  501. blk:WaitForChild(f).StudsPerTileU = 2.6
  502. blk:WaitForChild(f).StudsPerTileV = 2.6
  503. end
  504. elseif selectedBlock == 2 then
  505. local blk = placeBlock(toolBar.Stone, CFrame.new(x, y, z))
  506. for _,f in pairs(facesToResize) do
  507. blk:WaitForChild(f).StudsPerTileU = 2.6
  508. blk:WaitForChild(f).StudsPerTileV = 2.6
  509. end
  510. elseif selectedBlock == 3 then
  511. local blk = placeBlock(toolBar.Diamond_Ore, CFrame.new(x, y, z))
  512. for _,f in pairs(facesToResize) do
  513. blk:WaitForChild(f).StudsPerTileU = 2.6
  514. blk:WaitForChild(f).StudsPerTileV = 2.6
  515. end
  516. elseif selectedBlock == 4 then
  517. local blk = placeBlock(toolBar.Diamond_Block, CFrame.new(x, y, z))
  518. for _,f in pairs(facesToResize) do
  519. blk:WaitForChild(f).StudsPerTileU = 2.6
  520. blk:WaitForChild(f).StudsPerTileV = 2.6
  521. end
  522. elseif selectedBlock == 5 then
  523. local blk = placeBlock(toolBar.Wood_Planks, CFrame.new(x, y, z))
  524. for _,f in pairs(facesToResize) do
  525. blk:WaitForChild(f).StudsPerTileU = 2.6
  526. blk:WaitForChild(f).StudsPerTileV = 2.6
  527. end
  528. elseif selectedBlock == 6 then
  529. local blk = placeBlock(toolBar.Oak_Log, CFrame.new(x, y, z))
  530. for _,f in pairs(facesToResize) do
  531. blk:WaitForChild(f).StudsPerTileU = 2.6
  532. blk:WaitForChild(f).StudsPerTileV = 2.6
  533. end
  534. elseif selectedBlock == 7 or selectedBlock == 8 then
  535. if Mouse.Target.Size.X <= 10 and Mouse.Target.Size.Y <= 10 and Mouse.Target.Size.Z <= 10 then
  536. Mouse.Target.Parent = nil
  537. end
  538. end
  539. end
  540. end
  541. end)
  542.  
  543. local hasItemOnHand = 0
  544. local hi = 0
  545. -- selection thingy
  546. local selectLabel = Instance.new("TextLabel", gui)
  547. selectLabel.Size = UDim2.new(0, 32, 0, 32)
  548. selectLabel.Position = UDim2.new(0.5, -160 + (selectedBlock*40), 1, -105)
  549. selectLabel.BackgroundTransparency = 0.5
  550. selectLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  551. selectLabel.BorderSizePixel = 0
  552. selectLabel.Text = ""
  553. selectLabel.ZIndex = 3
  554. --
  555. Mouse.KeyDown:connect(function(key)
  556. if key == "q" then
  557. sneaking = 1
  558. humanoid.WalkSpeed = humanoid.WalkSpeed / 2
  559. rootJoint.C1 = CFrame.new(0, 0.325, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  560. lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*45), 0, 0)
  561. rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  562. --print("Sneaking...")
  563. end
  564. if key == "8" then
  565. selectedBlock = 7
  566. itemOnHand = nil
  567. for _,d in pairs(handItem:GetChildren()) do
  568. d:Destroy()
  569. end
  570. if hasItemOnHand == 1 then hi = 1 end
  571. end
  572. if key == "9" then
  573. selectedBlock = 8
  574. itemOnHand = nil
  575. for _,d in pairs(handItem:GetChildren()) do
  576. d:Destroy()
  577. end
  578. if hasItemOnHand == 1 then hi = 1 end
  579. end
  580. if key == "1" then
  581. selectedBlock = 0
  582. itemOnHand = toolBar.Dirt
  583. for _,d in pairs(handItem:GetChildren()) do
  584. d:Destroy()
  585. end
  586. putTexture(handItem, itemOnHand.frontTex, itemOnHand.backTex,
  587. itemOnHand.topTex, itemOnHand.bottomTex,
  588. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  589. for _,f in pairs(facesToResize) do
  590. handItem:WaitForChild(f).StudsPerTileU = 0.52
  591. handItem:WaitForChild(f).StudsPerTileV = 0.52
  592. end
  593. end
  594. if key == "2" then
  595. selectedBlock = 1
  596. itemOnHand = toolBar.Grass
  597. for _,d in pairs(handItem:GetChildren()) do
  598. d:Destroy()
  599. end
  600. putTexture(handItem, itemOnHand.frontTex, itemOnHand.backTex,
  601. itemOnHand.topTex, itemOnHand.bottomTex,
  602. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  603. for _,f in pairs(facesToResize) do
  604. handItem:WaitForChild(f).StudsPerTileU = 0.52
  605. handItem:WaitForChild(f).StudsPerTileV = 0.52
  606. end
  607. end
  608. if key == "3" then
  609. selectedBlock = 2
  610. itemOnHand = toolBar.Stone
  611. for _,d in pairs(handItem:GetChildren()) do
  612. d:Destroy()
  613. end
  614. putTexture(handItem, itemOnHand.frontTex, itemOnHand.backTex,
  615. itemOnHand.topTex, itemOnHand.bottomTex,
  616. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  617. for _,f in pairs(facesToResize) do
  618. handItem:WaitForChild(f).StudsPerTileU = 0.52
  619. handItem:WaitForChild(f).StudsPerTileV = 0.52
  620. end
  621. end
  622. if key == "4" then
  623. selectedBlock = 3
  624. itemOnHand = toolBar.Diamond_Ore
  625. for _,d in pairs(handItem:GetChildren()) do
  626. d:Destroy()
  627. end
  628. putTexture(handItem, itemOnHand.frontTex, itemOnHand.backTex,
  629. itemOnHand.topTex, itemOnHand.bottomTex,
  630. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  631. for _,f in pairs(facesToResize) do
  632. handItem:WaitForChild(f).StudsPerTileU = 0.52
  633. handItem:WaitForChild(f).StudsPerTileV = 0.52
  634. end
  635. end
  636. if key == "5" then
  637. selectedBlock = 4
  638. itemOnHand = toolBar.Diamond_Block
  639. for _,d in pairs(handItem:GetChildren()) do
  640. d:Destroy()
  641. end
  642. putTexture(handItem, itemOnHand.frontTex, itemOnHand.backTex,
  643. itemOnHand.topTex, itemOnHand.bottomTex,
  644. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  645. for _,f in pairs(facesToResize) do
  646. handItem:WaitForChild(f).StudsPerTileU = 0.52
  647. handItem:WaitForChild(f).StudsPerTileV = 0.52
  648. end
  649. end
  650. if key == "6" then
  651. selectedBlock = 5
  652. itemOnHand = toolBar.Wood_Planks
  653. for _,d in pairs(handItem:GetChildren()) do
  654. d:Destroy()
  655. end
  656. putTexture(handItem, itemOnHand.frontTex, itemOnHand.backTex,
  657. itemOnHand.topTex, itemOnHand.bottomTex,
  658. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  659. for _,f in pairs(facesToResize) do
  660. handItem:WaitForChild(f).StudsPerTileU = 0.52
  661. handItem:WaitForChild(f).StudsPerTileV = 0.52
  662. end
  663. end
  664. if key == "7" then
  665. selectedBlock = 6
  666. itemOnHand = toolBar.Oak_Log
  667. for _,d in pairs(handItem:GetChildren()) do
  668. d:Destroy()
  669. end
  670. putTexture(handItem, itemOnHand.frontTex, itemOnHand.backTex,
  671. itemOnHand.topTex, itemOnHand.bottomTex,
  672. itemOnHand.leftTex, itemOnHand.rightTex, "Texture")
  673. for _,f in pairs(facesToResize) do
  674. handItem:WaitForChild(f).StudsPerTileU = 0.52
  675. handItem:WaitForChild(f).StudsPerTileV = 0.52
  676. end
  677. end
  678. if (key == "0" or key == "1" or key == "2"
  679. or key == "3" or key == "4" or key == "5"
  680. or key == "6" or key == "7") and hasItemOnHand == 0 then hi = 1 end
  681. selectLabel.Position = UDim2.new(0.5, -160 + ((selectedBlock)*40), 1, -105)
  682. end)
  683.  
  684. Mouse.KeyUp:connect(function(key)
  685. if key == "q" then
  686. sneaking = 0
  687. humanoid.WalkSpeed = humanoid.WalkSpeed * 2
  688. rootJoint.C1 = CFrame.new(0, 0.05, 0) * CFrame.Angles(0, 0, 0)
  689. lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(0, 0, 0)
  690. rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(0, 0, 0)
  691. --print("Stopped sneaking...")
  692. end
  693. end)
  694.  
  695. while RS:wait() do
  696. if itemOnHand ~= nil then
  697. hasItemOnHand = 1
  698. handItem.Transparency = 0
  699. else
  700. hasItemOnHand = 0
  701. handItem.Transparency = 1
  702. end
  703. if humanoid.Health < oldHP then
  704. damageTime = 60
  705. sound:Play()
  706. end
  707. oldHP = humanoid.Health
  708. if damageTime > 0 and humanoid.Health > 0 then
  709. for _,p in pairs(char:GetChildren()) do
  710. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  711. if p.Name == "DamagePart" then
  712. p.Transparency = 0.5
  713. end
  714. end
  715. end
  716. damageTime = damageTime - 2
  717. if damageTime <= 0 then
  718. for _,p in pairs(char:GetChildren()) do
  719. if p.Name ~= "HumanoidRootPart" and p.ClassName == "Part" then
  720. if p.Name == "DamagePart" then
  721. p.Transparency = 1
  722. end
  723. end
  724. end
  725. end
  726. end
  727. camPart.CFrame = camera.CFrame
  728. neck.C1 = CFrame.new(0, 0.975, 0) * CFrame.fromEulerAnglesXYZ(math.rad(sneaking*45), math.rad(camPart.Orientation.Y - torso.Orientation.Y), 0)
  729. neck.C0 = CFrame.new(0, -0.65, 0) * CFrame.Angles(-math.rad(camPart.Orientation.X - torso.Orientation.X - (sneaking*45)), 0, 0)
  730.  
  731. if getMagnitudeXZ(torso.Velocity) > 1 then
  732. if walkAnim >= 1 then
  733. increaseWalkAnim = -1
  734. elseif walkAnim <= -1 then
  735. increaseWalkAnim = 1
  736. end
  737. walkAnim = walkAnim + (increaseWalkAnim/(10+(sneaking*20)))
  738. else
  739. walkAnim = 0
  740. end
  741.  
  742. --lH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*45), 0, 0)
  743. --rH.C0 = CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*45), 0, 0)
  744. lH.C0 = lH.C0:lerp(CFrame.new(0, 0.975, 0) * CFrame.Angles(-math.rad(sneaking*45) + math.rad(damageTime*1.5) + math.rad(walkAnim*getMagnitudeXZ(torso.Velocity)*5/(1+sneaking)), 0, 0), 0.1)
  745. rH.C0 = rH.C0:lerp(CFrame.new(0, 0.975, 0) * CFrame.Angles(math.rad(sneaking*45) + math.rad(damageTime*1.5) + math.rad(walkAnim*getMagnitudeXZ(torso.Velocity)*5/(1+sneaking)), 0, 0), 0.1)
  746. --
  747. --rootJoint.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
  748. --print(math.abs(head.Orientation.Y) - math.abs(humRootPart.Orientation.Y))
  749. --if (head.Orientation.Y * 2) - (head.Orientation.Y + torso.Orientation.Y) > 45 then
  750. --humRootPart.CFrame = humRootPart.CFrame * CFrame.Angles(0, math.rad(-45 + head.Orientation.Y), 0)
  751. --print("-45")
  752. --end
  753. --if (head.Orientation.Y * 2) - (head.Orientation.Y + torso.Orientation.Y) < -45 then
  754. --humRootPart.CFrame = humRootPart.CFrame * CFrame.Angles(0, math.rad(45 + head.Orientation.Y), 0)
  755. --print("45")
  756. --end
  757.  
  758. --move these arms
  759. rootJoint.C1 = rootJoint.C1:lerp(CFrame.new(0, 0.325, 0) * CFrame.Angles(math.rad(sneaking*45), math.rad(punchRotY), 0), 0.2)
  760.  
  761. lS.C0 = lS.C0:lerp(CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(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) + divide(punchSpeed, 6) + hi)
  762. rS.C0 = rS.C0:lerp(CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(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))
  763. if punching == 1 and punchEnded == 1 then
  764. punching = 0
  765. --print("steve uses punch!!")
  766. local coPunch = coroutine.wrap(function()
  767. punchEnded = 0
  768. punchSpeed = 1
  769. punchRotX = -60
  770. punchRotY = -8
  771. punchRotZ = -35
  772. wait(0.075)
  773. punchSpeed = 1
  774. punchRotX = -75
  775. punchRotY = 8
  776. punchRotZ = 40
  777. wait(0.075)
  778. punchSpeed = 1
  779. punchRotX = -20
  780. punchRotZ = 40
  781. wait(0.075)
  782. punchSpeed = 3.5
  783. punchRotX = 0
  784. punchRotY = 0
  785. punchRotZ = 0
  786. punchEnded = 1
  787. wait(0.06)
  788. punchSpeed = 0
  789. end)
  790. coPunch()
  791. end
  792. if ticks > 20 then
  793. ticks = 0
  794. if times == 0 then
  795. times = times + 1
  796. idleAnimRotX = -1
  797. idleAnimRotZ = 0
  798. elseif times == 1 then
  799. times = times + 1
  800. idleAnimRotX = -0.75
  801. idleAnimRotZ = -0.75
  802. elseif times == 2 then
  803. times = times + 1
  804. idleAnimRotX = 0
  805. idleAnimRotZ = -1
  806. elseif times == 3 then
  807. times = times + 1
  808. idleAnimRotX = 0.75
  809. idleAnimRotZ = -0.75
  810. --idleAnimRotX = 0.75
  811. --idleAnimRotZ = -0
  812. elseif times == 4 then
  813. times = times + 1
  814. idleAnimRotX = 1
  815. idleAnimRotZ = 0
  816. --idleAnimRotX = 1
  817. --idleAnimRotZ = 0
  818. elseif times == 5 then
  819. times = times + 1
  820. idleAnimRotX = 0.75
  821. idleAnimRotZ = 0.75
  822. elseif times == 6 then
  823. times = times + 1
  824. idleAnimRotX = 0
  825. idleAnimRotZ = 1
  826. elseif times == 7 then
  827. times = 0
  828. idleAnimRotX = -0.75
  829. idleAnimRotZ = 0.75
  830. end
  831. end
  832. if hi == 1 then hi = 0 end
  833. ticks = ticks + 1
  834. end
  835. end
  836. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement