Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Decompiled with the Synapse X Luau decompiler.
- local plr = game.Player.LocalPlayer
- plr.Backpack.Harpoon.LocalScript:Destroy()
- script.Parent = plr.Backpack.Harpoon
- local l__RenderStepped__1 = game:GetService("RunService").RenderStepped;
- local l__LocalPlayer__2 = game.Players.LocalPlayer;
- local l__mouse__3 = l__LocalPlayer__2:GetMouse();
- local u1 = false;
- local u2 = nil;
- local l__WeaponDisplay__3 = script.Parent:WaitForChild("WeaponDisplay");
- local u4 = math.huge;
- local u5 = false;
- local u6 = nil;
- local u7 = nil;
- script.Parent.Equipped:connect(function()
- u1 = true;
- u2 = l__WeaponDisplay__3:Clone();
- u2.Parent = game.Players.LocalPlayer.PlayerGui;
- u2.Frame.Ammo.Text = u4 .. " / " .. 1;
- game:GetService("ContextActionService"):BindAction("Reload", reload, false, "r");
- game:GetService("UserInputService").InputBegan:connect(function(p1)
- if p1.KeyCode == Enum.KeyCode.ButtonX then
- reload();
- end;
- end);
- u2.Frame.ReloadReminder.MouseButton1Click:connect(reload);
- u2.Frame.ShootButton.MouseButton1Down:connect(fireWeapon);
- u2.Frame.ShootButton.MouseButton1Up:connect(stopFiring);
- if game:GetService("UserInputService").GamepadEnabled then
- u2.Frame.ReloadReminder.xboxHint.Visible = true;
- u2.Frame.ShootButton.xboxHint.Visible = true;
- end;
- if game:GetService("UserInputService").TouchEnabled == true then
- u2.Frame.Size = UDim2.new(0.1, 0, 0.1, 0);
- u2.Frame.Position = UDim2.new(1, -10, 0.4, 0);
- u2.Frame.ShootButton.Visible = true;
- u2.MobileAim.Visible = true;
- u5 = true;
- end;
- u6 = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Idle);
- u7 = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Shoot);
- u6:Play();
- end);
- local u8 = false;
- local u9 = false;
- script.Parent.Unequipped:connect(function()
- u1 = false;
- u8 = false;
- u9 = false;
- local l__WeaponDisplay__4 = game.Players.LocalPlayer.PlayerGui:FindFirstChild("WeaponDisplay");
- if l__WeaponDisplay__4 then
- l__WeaponDisplay__4:Destroy();
- end;
- u6:Stop();
- u7:Stop();
- game:GetService("ContextActionService"):UnbindAction("Reload");
- end);
- game.Players.LocalPlayer.Character.Humanoid.Died:connect(function()
- local l__WeaponDisplay__5 = game.Players.LocalPlayer.PlayerGui:FindFirstChild("WeaponDisplay");
- if l__WeaponDisplay__5 then
- l__WeaponDisplay__5:Destroy();
- end;
- end);
- l__mouse__3.Button1Down:connect(function()
- if not u5 then
- while wait() do
- fireWeapon();
- end
- end;
- end);
- local l__Projectiles__10 = game.Workspace.Events.Projectiles;
- local u11 = 0;
- function fireWeapon()
- if u1 then
- if not u8 then
- if not u9 then
- if game:GetService("UserInputService").GamepadEnabled then
- u2.Frame.ReloadReminder.xboxHint.Visible = true;
- end;
- if u4 == 0 then
- u2.Frame.ReloadReminder.Visible = true;
- return;
- end;
- u8 = true;
- u4 = u4 - 1;
- if script.Parent:FindFirstChild("Harpoon") then
- script.Parent.Harpoon.Transparency = 1;
- end;
- if u4 == 0 then
- u2.Frame.ReloadReminder.Visible = true;
- end;
- u2.Frame.Ammo.Text = u4 .. " / " .. 1;
- local v6 = script.Parent.Handle.FireSound:Clone();
- v6.Parent = script.Parent.Handle;
- v6:Destroy();
- game.Workspace.Events.Projectiles.GunSound:FireServer(script.Parent.Handle);
- u7:Play();
- if l__LocalPlayer__2.Character then
- if 0 < l__LocalPlayer__2.Character.Humanoid.Health then
- local v7 = l__mouse__3.Hit;
- if u5 then
- local l__AbsolutePosition__8 = u2.MobileAim.AbsolutePosition;
- local l__AbsoluteSize__9 = u2.MobileAim.AbsoluteSize;
- local l__Magnitude__10 = (l__LocalPlayer__2.Character.Head.Position - game.Workspace.CurrentCamera.CFrame.p).Magnitude;
- local v11 = game.Workspace.CurrentCamera:ScreenPointToRay(l__AbsolutePosition__8.X + l__AbsoluteSize__9.X / 2, l__AbsolutePosition__8.Y + l__AbsoluteSize__9.Y / 2, 0);
- local v12, v13 = game.Workspace:FindPartOnRay(Ray.new(v11.Origin, v11.Direction * 10000), l__LocalPlayer__2.Character);
- v7 = CFrame.new(v13);
- end;
- local l__Position__14 = script.Parent.Handle.Position;
- local l__lookVector__15 = CFrame.new(l__Position__14, v7.p).lookVector;
- l__Projectiles__10.ProjectileRenderEvent:FireServer(0, l__LocalPlayer__2.Name, 1, l__Position__14, v7, 20, 1000, "Harpoon");
- coroutine.wrap(function()
- local v16 = game.ReplicatedStorage.Harpoon:Clone();
- v16.Parent = game.Workspace;
- local v17 = 0;
- local v18 = l__Position__14;
- local v19 = 2;
- while true do
- if v17 < 1000 then
- else
- break;
- end;
- local v20, v21 = game.Workspace:FindPartOnRay(Ray.new(v18, l__lookVector__15.unit * v19), game.Players.LocalPlayer.Character, true, true);
- v18 = v21;
- if not v20 then
- else
- local l__Body__22 = v20.Parent:FindFirstChild("Body");
- if l__Body__22 then
- l__Projectiles__10.HealthChange:FireServer(l__Body__22.Parent.OwnerName.Value, 65, u11);
- end;
- local l__Body__23 = v20.Parent.Parent:FindFirstChild("Body");
- if l__Body__23 then
- l__Projectiles__10.HealthChange:FireServer(l__Body__23.Parent.OwnerName.Value, 65, u11);
- end;
- l__Projectiles__10.ProjectileRenderEvent:FireServer(1, l__LocalPlayer__2.Name, 1, l__Position__14, v7, 20, 1000, "Harpoon", v20, u11);
- break;
- end;
- v16.CFrame = CFrame.new(v18, v18 + l__lookVector__15);
- if v19 * 2 < 20 then
- v19 = v19 * 2;
- elseif v19 ~= 20 then
- v19 = 20;
- end;
- v17 = v17 + v19;
- l__RenderStepped__1:wait();
- end;
- v16:Destroy();
- end)();
- end;
- end;
- wait(0.7);
- u8 = false;
- u7:Stop();
- end;
- end;
- end;
- end;
- function stopFiring()
- if u1 then
- u8 = false;
- end;
- end;
- l__mouse__3.Button1Up:connect(function()
- stopFiring();
- end);
- local u12 = 0;
- function reload()
- if u9 then
- return;
- end;
- u12 = u12 + 1;
- u9 = true;
- u8 = false;
- script.Parent.Handle.ReloadSound:Play();
- wait(1.5);
- if u12 ~= u12 then
- print("cancel reload");
- return;
- end;
- u4 = math.huge;
- u2.Frame.Ammo.Text = u4 .. " / " .. 1;
- u2.Frame.ReloadReminder.Visible = false;
- if script.Parent:FindFirstChild("Harpoon") then
- script.Parent.Harpoon.Transparency = 0;
- end;
- u9 = false;
- end;
- game.Workspace.Events.S.SEvent.OnClientEvent:connect(function(p2)
- u11 = p2;
- end);
Add Comment
Please, Sign In to add comment