Advertisement
XZTablets

Untitled

Aug 26th, 2020
1,210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.92 KB | None | 0 0
  1. -- Decompiled with the Synapse X Luau decompiler.
  2.  
  3. local v1 = require(game:GetService("ReplicatedStorage"):WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"));
  4. local l__ToolScript__2 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "tool", "tool-script").ToolScript;
  5. local v3 = setmetatable({}, {
  6.     __index = l__ToolScript__2,
  7.     __tostring = function()
  8.         return "AxeTool";
  9.     end
  10. });
  11. v3.__index = v3;
  12. function v3.new(...)
  13.     local v4 = setmetatable({}, v3);
  14.     v4:constructor(...);
  15.     return v4;
  16. end;
  17. local u1 = l__ToolScript__2;
  18. local l__BlockHighlightBehaivor__2 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "tool", "behaivor", "block-highlight").BlockHighlightBehaivor;
  19. local l__BlockMeta__3 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "block", "block-meta").BlockMeta;
  20. local l__BlockUtils__4 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "util", "block-utils").BlockUtils;
  21. local l__SkyblockAnimation__5 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "animation", "animation-meta").SkyblockAnimation;
  22. function v3.constructor(p1, p2)
  23.     u1.constructor(p1, p2);
  24.     u1.addBehaivor(p1, l__BlockHighlightBehaivor__2.new(p1, function(p3)
  25.         if l__BlockMeta__3[p3.Name].notBreakable then
  26.             return false;
  27.         end;
  28.         local v5 = l__BlockUtils__4.getBlocksFromLocation(p3.Position + Vector3.new(0, l__BlockUtils__4.BLOCK_SIZE, 0), {}, 1, true);
  29.         for v6 = 1, #v5 do
  30.             local v7 = l__BlockMeta__3[v5[v6].Name];
  31.             if v7 and v7.notBreakable == true and v7.foundation ~= true then
  32.                 return false;
  33.             end;
  34.         end;
  35.         return true;
  36.     end));
  37.     p1.canHitBlocks = true;
  38.     p1.blockHitDelay = 0.7;
  39.     p1.blockHitAnimationId = l__SkyblockAnimation__5.PLAYER_BLOCK_HIT;
  40. end;
  41. function v3.onEquip(p4)
  42.  
  43. end;
  44. function v3.onUnequip(p5)
  45.  
  46. end;
  47. local l__IslandUtils__6 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "util", "island-utils").IslandUtils;
  48. local u7 = v1.import(script, v1.getModule(script, "net").out);
  49. local l__Requests__8 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "network", "requests").Requests;
  50. local l__TutorialStepId__9 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "player", "tutorial-steps").TutorialStepId;
  51. function v3.onBlockHit(p6, p7, p8, p9, p10)
  52.     local v8 = l__IslandUtils__6.getIslandModelFromBlock(p7);
  53.     if v8 and not l__IslandUtils__6.canModifyIsland(p6.player, v8) then
  54.         return nil;
  55.     end;
  56.     if l__BlockMeta__3[p7.Name].notBreakable then
  57.         return nil;
  58.     end;
  59.     local v9 = l__BlockUtils__4.getBlocksFromLocation(p7.Position + Vector3.new(0, l__BlockUtils__4.BLOCK_SIZE, 0), {}, 1, true);
  60.     for v10 = 1, #v9 do
  61.         local v11 = l__BlockMeta__3[v9[v10].Name];
  62.         if v11 and v11.notBreakable == true and v11.foundation ~= true then
  63.             return nil;
  64.         end;
  65.     end;
  66.     local v12 = l__BlockUtils__4.calculateBlockHitDamage(p6.script.Parent, p7);
  67.     local v13 = nil;
  68.     if p7.Health.Value <= v12 then
  69.         v13 = p7.Parent;
  70.         l__BlockUtils__4.blockBreakEffect(p7.Name, p7.Position, true);
  71.         p7.Parent = nil;
  72.     elseif p7 then
  73.         l__BlockUtils__4.blockHitEffect(p7, true, p8, p9, p10);
  74.         v1.Promise.spawn(function()
  75.             p6:handleHealthbarChange(p7, p7.Health.Value - v12);
  76.         end);
  77.     end;
  78.     v1.Promise.spawn(function()
  79.         if u7.ClientFunction.new(l__Requests__8.CLIENT_BLOCK_HIT_REQUEST):CallServer({
  80.             block = p7,
  81.             part = p8,
  82.             pos = p9,
  83.             norm = p10
  84.         }).destroyed then
  85.             print("block destroyed.");
  86.             print("block broke:", p7.Name);
  87.             if string.find(p7.Name, "tree", 1, true) ~= nil then
  88.                 print("broke tree.");
  89.                 p6.player.TutorialStepCompleteEvent:Fire(l__TutorialStepId__9.BREAK_TREE);
  90.                 return;
  91.             end;
  92.             if p7.Name == "grass" then
  93.                 p6.player.TutorialStepCompleteEvent:Fire(l__TutorialStepId__9.BREAK_GRASS);
  94.                 return;
  95.             end;
  96.             if p7.Name == "rockIron" then
  97.                 p6.player.TutorialStepCompleteEvent:Fire(l__TutorialStepId__9.BREAK_IRON_ROCK);
  98.                 return;
  99.             end;
  100.         elseif v13 and not p7.Parent then
  101.             p7.Parent = v13;
  102.         end;
  103.     end);
  104. end;
  105. local l__BlockConstants__10 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "util", "block-constants").BlockConstants;
  106. local l__TweenService__11 = v1.import(script, v1.getModule(script, "services")).TweenService;
  107. function v3.handleHealthbarChange(p11, p12, p13)
  108.     local v14 = l__BlockMeta__3[p12.Name];
  109.     local l__health__15 = v14.health;
  110.     if l__health__15 ~= 0 and l__health__15 == l__health__15 and l__health__15 then
  111.         local v16 = v14.health;
  112.     else
  113.         v16 = l__BlockConstants__10.DEFAULT_BLOCK_HEALTH;
  114.     end;
  115.     local v17 = p12:FindFirstChild("Healthbar");
  116.     if not v17 then
  117.         v17 = Instance.new("BillboardGui");
  118.         v17.Name = "Healthbar";
  119.         v17.Size = UDim2.new(4, 0, 0, 40);
  120.         v17.StudsOffset = Vector3.new(0, 2.5, 0);
  121.         v17.MaxDistance = 40;
  122.         v17.LightInfluence = 0;
  123.         v17.AlwaysOnTop = true;
  124.         local v18 = Instance.new("UIListLayout");
  125.         v18.FillDirection = Enum.FillDirection.Vertical;
  126.         v18.SortOrder = Enum.SortOrder.LayoutOrder;
  127.         v18.Parent = v17;
  128.         local v19 = Instance.new("Frame");
  129.         v19.Size = UDim2.new(1, 0, 0, 4);
  130.         v19.BackgroundColor3 = Color3.fromRGB(0, 0, 0);
  131.         v19.BorderSizePixel = 0;
  132.         v19.LayoutOrder = 2;
  133.         v19.Name = "HealthBack";
  134.         v19.Parent = v17;
  135.         local v20 = Instance.new("Frame");
  136.         v20.Size = UDim2.new(1, 0, 1, 0);
  137.         v20.BackgroundColor3 = Color3.fromRGB(39, 231, 68);
  138.         v20.BorderSizePixel = 0;
  139.         v20.Name = "HealthFront";
  140.         v20.Parent = v19;
  141.         v17.Parent = p12;
  142.     end;
  143.     l__TweenService__11:Create(v17:FindFirstChild("HealthBack"):FindFirstChild("HealthFront"), TweenInfo.new(0.14, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {
  144.         Size = UDim2.new(p13 / v16, 0, 1, 0)
  145.     }):Play();
  146.     local v21 = p12:FindFirstChild("LastHitAt");
  147.     if v21 then
  148.         v21.Value = tick();
  149.     else
  150.         v21 = Instance.new("NumberValue");
  151.         v21.Value = tick();
  152.         v21.Name = "LastHitAt";
  153.         v21.Parent = p12;
  154.     end;
  155.     wait(1.2);
  156.     if tick() - v21.Value >= 1.2 and v17 then
  157.         v17:Destroy();
  158.     end;
  159. end;
  160. u1 = v3.new;
  161. u1(script);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement