Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Decompiled with the Synapse X Luau decompiler.
- local v1 = require(game:GetService("ReplicatedStorage"):WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"));
- local l__ToolScript__2 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "tool", "tool-script").ToolScript;
- local v3 = setmetatable({}, {
- __index = l__ToolScript__2,
- __tostring = function()
- return "AxeTool";
- end
- });
- v3.__index = v3;
- function v3.new(...)
- local v4 = setmetatable({}, v3);
- v4:constructor(...);
- return v4;
- end;
- local u1 = l__ToolScript__2;
- local l__BlockHighlightBehaivor__2 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "tool", "behaivor", "block-highlight").BlockHighlightBehaivor;
- local l__BlockMeta__3 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "block", "block-meta").BlockMeta;
- local l__BlockUtils__4 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "util", "block-utils").BlockUtils;
- local l__SkyblockAnimation__5 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "animation", "animation-meta").SkyblockAnimation;
- function v3.constructor(p1, p2)
- u1.constructor(p1, p2);
- u1.addBehaivor(p1, l__BlockHighlightBehaivor__2.new(p1, function(p3)
- if l__BlockMeta__3[p3.Name].notBreakable then
- return false;
- end;
- local v5 = l__BlockUtils__4.getBlocksFromLocation(p3.Position + Vector3.new(0, l__BlockUtils__4.BLOCK_SIZE, 0), {}, 1, true);
- for v6 = 1, #v5 do
- local v7 = l__BlockMeta__3[v5[v6].Name];
- if v7 and v7.notBreakable == true and v7.foundation ~= true then
- return false;
- end;
- end;
- return true;
- end));
- p1.canHitBlocks = true;
- p1.blockHitDelay = 0.7;
- p1.blockHitAnimationId = l__SkyblockAnimation__5.PLAYER_BLOCK_HIT;
- end;
- function v3.onEquip(p4)
- end;
- function v3.onUnequip(p5)
- end;
- local l__IslandUtils__6 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "util", "island-utils").IslandUtils;
- local u7 = v1.import(script, v1.getModule(script, "net").out);
- local l__Requests__8 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "network", "requests").Requests;
- local l__TutorialStepId__9 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "player", "tutorial-steps").TutorialStepId;
- function v3.onBlockHit(p6, p7, p8, p9, p10)
- local v8 = l__IslandUtils__6.getIslandModelFromBlock(p7);
- if v8 and not l__IslandUtils__6.canModifyIsland(p6.player, v8) then
- return nil;
- end;
- if l__BlockMeta__3[p7.Name].notBreakable then
- return nil;
- end;
- local v9 = l__BlockUtils__4.getBlocksFromLocation(p7.Position + Vector3.new(0, l__BlockUtils__4.BLOCK_SIZE, 0), {}, 1, true);
- for v10 = 1, #v9 do
- local v11 = l__BlockMeta__3[v9[v10].Name];
- if v11 and v11.notBreakable == true and v11.foundation ~= true then
- return nil;
- end;
- end;
- local v12 = l__BlockUtils__4.calculateBlockHitDamage(p6.script.Parent, p7);
- local v13 = nil;
- if p7.Health.Value <= v12 then
- v13 = p7.Parent;
- l__BlockUtils__4.blockBreakEffect(p7.Name, p7.Position, true);
- p7.Parent = nil;
- elseif p7 then
- l__BlockUtils__4.blockHitEffect(p7, true, p8, p9, p10);
- v1.Promise.spawn(function()
- p6:handleHealthbarChange(p7, p7.Health.Value - v12);
- end);
- end;
- v1.Promise.spawn(function()
- if u7.ClientFunction.new(l__Requests__8.CLIENT_BLOCK_HIT_REQUEST):CallServer({
- block = p7,
- part = p8,
- pos = p9,
- norm = p10
- }).destroyed then
- print("block destroyed.");
- print("block broke:", p7.Name);
- if string.find(p7.Name, "tree", 1, true) ~= nil then
- print("broke tree.");
- p6.player.TutorialStepCompleteEvent:Fire(l__TutorialStepId__9.BREAK_TREE);
- return;
- end;
- if p7.Name == "grass" then
- p6.player.TutorialStepCompleteEvent:Fire(l__TutorialStepId__9.BREAK_GRASS);
- return;
- end;
- if p7.Name == "rockIron" then
- p6.player.TutorialStepCompleteEvent:Fire(l__TutorialStepId__9.BREAK_IRON_ROCK);
- return;
- end;
- elseif v13 and not p7.Parent then
- p7.Parent = v13;
- end;
- end);
- end;
- local l__BlockConstants__10 = v1.import(script, game:GetService("ReplicatedStorage"), "TS", "util", "block-constants").BlockConstants;
- local l__TweenService__11 = v1.import(script, v1.getModule(script, "services")).TweenService;
- function v3.handleHealthbarChange(p11, p12, p13)
- local v14 = l__BlockMeta__3[p12.Name];
- local l__health__15 = v14.health;
- if l__health__15 ~= 0 and l__health__15 == l__health__15 and l__health__15 then
- local v16 = v14.health;
- else
- v16 = l__BlockConstants__10.DEFAULT_BLOCK_HEALTH;
- end;
- local v17 = p12:FindFirstChild("Healthbar");
- if not v17 then
- v17 = Instance.new("BillboardGui");
- v17.Name = "Healthbar";
- v17.Size = UDim2.new(4, 0, 0, 40);
- v17.StudsOffset = Vector3.new(0, 2.5, 0);
- v17.MaxDistance = 40;
- v17.LightInfluence = 0;
- v17.AlwaysOnTop = true;
- local v18 = Instance.new("UIListLayout");
- v18.FillDirection = Enum.FillDirection.Vertical;
- v18.SortOrder = Enum.SortOrder.LayoutOrder;
- v18.Parent = v17;
- local v19 = Instance.new("Frame");
- v19.Size = UDim2.new(1, 0, 0, 4);
- v19.BackgroundColor3 = Color3.fromRGB(0, 0, 0);
- v19.BorderSizePixel = 0;
- v19.LayoutOrder = 2;
- v19.Name = "HealthBack";
- v19.Parent = v17;
- local v20 = Instance.new("Frame");
- v20.Size = UDim2.new(1, 0, 1, 0);
- v20.BackgroundColor3 = Color3.fromRGB(39, 231, 68);
- v20.BorderSizePixel = 0;
- v20.Name = "HealthFront";
- v20.Parent = v19;
- v17.Parent = p12;
- end;
- l__TweenService__11:Create(v17:FindFirstChild("HealthBack"):FindFirstChild("HealthFront"), TweenInfo.new(0.14, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {
- Size = UDim2.new(p13 / v16, 0, 1, 0)
- }):Play();
- local v21 = p12:FindFirstChild("LastHitAt");
- if v21 then
- v21.Value = tick();
- else
- v21 = Instance.new("NumberValue");
- v21.Value = tick();
- v21.Name = "LastHitAt";
- v21.Parent = p12;
- end;
- wait(1.2);
- if tick() - v21.Value >= 1.2 and v17 then
- v17:Destroy();
- end;
- end;
- u1 = v3.new;
- u1(script);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement