Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- LocalScript3 = Instance.new("LocalScript")
- LocalScript4 = Instance.new("LocalScript")
- Animation5 = Instance.new("Animation")
- Camera6 = Instance.new("Camera")
- Sound7 = Instance.new("Sound")
- Tool0.Name = "Mackerel"
- Tool0.Parent = mas
- Tool0.TextureId = "http://www.roblox.com/asset/?id= 46156602 "
- Tool0.Grip = CFrame.new(0, -2, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Tool0.GripForward = Vector3.new(-1, 0, -0)
- Tool0.GripPos = Vector3.new(0, -2, 0)
- Tool0.GripRight = Vector3.new(0, 0, -1)
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.CFrame = CFrame.new(-2.09999847, 0.245092556, 4.36993933, -6.44848842e-06, -0.99999994, -5.96046448e-08, -1, 6.52701419e-06, -0.000248211581, 0.000248180353, 2.98023224e-08, -0.99999994)
- Part1.Orientation = Vector3.new(0.00999999978, -180, -90)
- Part1.Position = Vector3.new(-2.09999847, 0.245092556, 4.36993933)
- Part1.Rotation = Vector3.new(179.98999, 0, 90)
- Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part1.Transparency = 1
- Part1.Size = Vector3.new(0.490000129, 0.200000003, 0.740000129)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.BrickColor = BrickColor.new("Dark stone grey")
- Part1.Reflectance = 0.40000000596046
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Dark stone grey")
- Part1.FormFactor = Enum.FormFactor.Custom
- Part1.formFactor = Enum.FormFactor.Custom
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=46140354"
- SpecialMesh2.Scale = Vector3.new(0.800000012, 0.699999988, 0.699999988)
- SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=46140461"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- LocalScript3.Name = "Mackerel"
- LocalScript3.Parent = Tool0
- table.insert(cors,sandbox(LocalScript3,function()
- -- Mackerel --
- -- Whack Animation, time 0.5 seconds
- -- Whack Sound, 0.4 seconds
- -- Handle to the game service, in case we need to get the time
- r = game:service("RunService")
- -- normal damage, when the Mackerel touches a humanoid object
- local damage = 5
- -- Whack damage
- local whack_damage = 8
- -- Handle to tool
- Mackerel = script.Parent.Handle
- Tool = script.Parent
- -- For the Animations
- local WhackAnim
- -- Sounds!
- local MackerelWhack = Tool:FindFirstChild("FishWhack")
- if MackerelWhack == nil then
- MackerelWhack = Instance.new("Sound")
- MackerelWhack.Name = "FishWhack"
- MackerelWhack.SoundId = "http://www.roblox.com/asset/?id=46153268"
- MackerelWhack.Parent = Tool
- MackerelWhack.Volume = 1
- end
- -- When a collision is detected between the player and another character
- function blow(hit)
- if hit == nil or hit.Parent == nil then return end
- local opponent = hit.Parent:findFirstChild("Torso")
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local myTorso = vCharacter:findFirstChild("Torso")
- local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
- if humanoid~=nil and humanoid ~= hum and hum ~= nil then
- -- final check, make sure Mackerel is in-hand
- local right_arm = vCharacter:FindFirstChild("Right Arm")
- if (right_arm ~= nil) then
- local joint = right_arm:FindFirstChild("RightGrip")
- if (joint ~= nil and (joint.Part0 == Mackerel or joint.Part1 == Mackerel)) then
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- -- Add body velocity to the opponent to push him when he gets whacked
- local bodyVelocity = Instance.new("BodyVelocity")
- bodyVelocity.P = 100000
- bodyVelocity.maxForce = Vector3.new(bodyVelocity.P, bodyVelocity.P, bodyVelocity.P)
- bodyVelocity.velocity = (opponent.Position - myTorso.Position) * 6
- bodyVelocity.Parent = opponent
- wait(0.5)
- if bodyVelocity ~= nil then bodyVelocity:remove() end
- wait(0.5)
- untagHumanoid(humanoid)
- end
- end
- end
- end
- -- Tagging and Untagging primarily for the leaderboards
- function tagHumanoid(humanoid, player)
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = player
- creator_tag.Name = "creator"
- creator_tag.Parent = humanoid
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- -- On, left click!
- function attack()
- damage = whack_damage
- -- Play the sound
- if MackerelWhack then MackerelWhack:Play() end
- end
- -- Tentative lock
- Tool.Enabled = true
- function onActivated()
- if not Tool.Enabled then
- return
- end
- Tool.Enabled = false
- -- Check if the handle to the Player is still available in the space
- local MyPlayer = Tool.Parent
- if MyPlayer == nil then
- return
- end
- -- Check to see if the humanoid is still in the world
- local MyHumanoid= MyPlayer:FindFirstChild("Humanoid")
- if MyHumanoid == nil then
- return
- end
- attack()
- -- Load and play the animation
- WhackAnim = MyHumanoid:LoadAnimation(Tool.Whack)
- if WhackAnim then WhackAnim:Play() end
- -- To rotate the fish as the character swings
- Tool.GripForward = Vector3.new(-0.7071, 0.7071, 0.0)
- Tool.GripRight = Vector3.new(0.5774, 0.5774, -0.5774)
- Tool.GripUp = Vector3.new(0.4082, 0.4082, 0.8165)
- wait(0.5)
- -- Reset the fish to its original orientation
- Tool.GripForward = Vector3.new(-1.0, 0.0, 0.0)
- Tool.GripRight = Vector3.new(0.0, 0.0, -1.0)
- Tool.GripUp = Vector3.new(0.0, 1.0, 0.0)
- Tool.Enabled = true
- -- Reset the damage
- damage = 5
- end
- function onEquipped()
- -- Remove the sound if its still playing
- MackerelWhack.Volume = 1
- if MackerelWhack then MackerelWhack:Stop() end
- end
- function onUnequipped()
- -- Remove the sounds and the animations
- MackerelWhack.Volume = 0
- if WhackAnim then WhackAnim:Stop() end
- if MackerelWhack then MackerelWhack:Stop() end
- end
- Tool.Activated:connect(onActivated)
- Tool.Equipped:connect(onEquipped)
- Tool.Unequipped:connect(onUnequipped)
- connection = Mackerel.Touched:connect(blow)
- end))
- LocalScript4.Name = "Local Gui"
- LocalScript4.Parent = Tool0
- table.insert(cors,sandbox(LocalScript4,function()
- local Tool = script.Parent;
- local stillEquipped = true
- function onEquippedLocal(mouse)
- stillEquipped = true
- if mouse == nil then
- print("Mouse not found")
- return
- end
- while stillEquipped do
- print("Setting Mouse to Go")
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- while Tool.Enabled and stillEquipped do
- wait(.01)
- end
- print("Setting Mouse To Wait")
- mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
- while not Tool.Enabled and stillEquipped do
- wait(.01)
- end
- end
- end
- function onUnequippedLocal()
- stillEquipped = false
- end
- Tool.Equipped:connect(onEquippedLocal)
- Tool.Unequipped:connect(onUnequippedLocal)
- end))
- Animation5.Name = "Whack"
- Animation5.Parent = Tool0
- Animation5.AnimationId = "http://www.roblox.com/Asset?ID=46151856"
- Camera6.Name = "ThumbnailCamera"
- Camera6.Parent = Tool0
- Camera6.CFrame = CFrame.new(-0.941516638, 5.70548439, 0.0050331275, -0.0218932275, 0.985759676, -0.166728929, -2.32830644e-10, 0.166768894, 0.985996008, 0.99976033, 0.0215866342, -0.00365110952)
- Camera6.CoordinateFrame = CFrame.new(-0.941516638, 5.70548439, 0.0050331275, -0.0218932275, 0.985759676, -0.166728929, -2.32830644e-10, 0.166768894, 0.985996008, 0.99976033, 0.0215866342, -0.00365110952)
- Camera6.Focus = CFrame.new(-0.030002594, 0.315002859, 0.0249938965, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Camera6.focus = CFrame.new(-0.030002594, 0.315002859, 0.0249938965, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Sound7.Name = "FishWhack"
- Sound7.Parent = Tool0
- Sound7.SoundId = "http://www.roblox.com/asset/?id=46153268"
- Sound7.Volume = 0
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement