So I have this fishing pole that used to work (for R6) and was edited to fit with my new R15 game, but when I edited it and made it work, it no longer “displays” the catch, and I have 0 idea as to why, so I am going to show my old code vs my new code, hope you guys can help!
OLD CODE:
local Tool = script.Parent local debounce = false local mouse local Player = game.Players.LocalPlayer repeat wait() until Player.Character local Char = Player.Character local cast = false local CatchReady = false local Water local CatchPlayer = false local RightShoulder = Char:WaitForChild("RightUpperArm"):WaitForChild("RightShoulder") local C0Real = RightShoulder.C0 function GetMusic(musicID) local music = Instance.new('Sound') music.SoundId = 'rbxassetid://'..musicID return music end function Swing(pos,splash) Char.Humanoid.WalkSpeed = 0 for i = 1,10 do Char.RightUpperArm['RightShoulder'].C0 = Char.RightUpperArm['RightShoulder'].C0 * CFrame.Angles(0,0,0.17) wait() end local sound = GetMusic(244996548) sound.Looped = false sound.Parent = Player.Character.UpperTorso sound:Play() game.Debris:addItem(sound,5) for i = 1,14 do Char.RightUpperArm['RightShoulder'].C0 = Char.RightUpperArm['RightShoulder'].C0 * CFrame.Angles(0,0,-0.17) wait() end CastLine(pos,splash) for i = 1,2*3 do Char.RightUpperArm['RightShoulder'].C0 = Char.RightUpperArm['RightShoulder'].C0 * CFrame.Angles(0,0,0.17/3) wait() end end function displayCatch(name) local cl = game.ReplicatedStorage.DisplayCatch:clone() cl.Parent = Player.Character.Head cl:WaitForChild('TextLabel') cl.TextLabel.Text = name coroutine.resume(coroutine.create(function() for i = 1,100 do cl.StudsOffset = cl.StudsOffset + Vector3.new(0,0.05,0) cl.TextLabel.TextTransparency = cl.TextLabel.TextTransparency + 0.01 cl.TextLabel.TextStrokeTransparency = cl.TextLabel.TextStrokeTransparency + 0.01 wait() end cl:destroy() end)) end function CastLine(pos,splash) cast = true local x = Instance.new('Part',Char) -- Fishing bob local mesh = Instance.new('SpecialMesh',x) mesh.MeshType = Enum.MeshType.Sphere mesh.Scale = Vector3.new(0.6,0.6,0.6) x.Touched:connect(function(part) if part.Parent:findFirstChild('UpperTorso') and not CatchPlayer then CatchPlayer = true part.Parent.UpperTorso.CFrame = Char.UpperTorso.CFrame * CFrame.new(0,0,-1) displayCatch(part.Parent.Name) local sound = GetMusic(244994347) sound.Looped = false sound.Parent = Player.Character.Torso sound:play() game.Debris:addItem(sound,4) wait(1) CatchPlayer = false end end) x.Anchored = true --x.Shape = Enum.PartType.Ball x.FormFactor = Enum.FormFactor.Custom x.Size = Vector3.new(1,1,1) x.CFrame = pos x.BottomSurface = Enum.SurfaceType.Smooth x.TopSurface = Enum.SurfaceType.Smooth local s = script.BobScript:clone() s.Parent = x s.Disabled = false x.Name = 'Delete' local position = x local distance = (position.CFrame.p - Tool.Shoot.CFrame.p).magnitude local rayPart = Instance.new("Part", Char) local mesh = Instance.new('CylinderMesh',rayPart) mesh.Scale = Vector3.new(0.2,1,0.2) rayPart.Name = "Delete" rayPart.Material = Enum.Material.Fabric rayPart.Transparency = 0 rayPart.Anchored = true rayPart.CanCollide = false rayPart.TopSurface = Enum.SurfaceType.Smooth rayPart.BottomSurface = Enum.SurfaceType.Smooth rayPart.formFactor = Enum.FormFactor.Custom rayPart.Size = Vector3.new(0.2, distance, 0.2) rayPart.CFrame = CFrame.new(position.CFrame.p, Tool.Shoot.CFrame.p) * CFrame.new(0, 0, -distance/2) * CFrame.Angles(math.rad(90),0,0) coroutine.resume(coroutine.create(function() while cast do local distance = (position.CFrame.p - Tool.Shoot.CFrame.p).magnitude rayPart.Size = Vector3.new(0.2, distance, 0.2) rayPart.CFrame = CFrame.new(position.CFrame.p, Tool.Shoot.CFrame.p) * CFrame.new(0, 0, -distance/2) * CFrame.Angles(math.rad(90),0,0) wait() end end)) -- print'Catch ready, click again to get fish!' -- CatchReady = true coroutine.resume(coroutine.create(function() for i = 1,10 do if cast then wait(0.1) end end while cast do local ran if splash == true then if Player.Chance.Value*2 > 100 then ran = math.random(100,100) elseif Player.Chance.Value < 80 then ran = math.random(85,100) else ran = math.random(Player.Chance.Value*2,100) end else ran = math.random(Player.Chance.Value,100) end if ran == 100 then local sound = GetMusic(248267272) sound.Looped = true sound.Parent = Player.Backpack sound.Name = 'Reel' sound:Play() local gui = game.ReplicatedStorage.CatchNow:clone() gui.Parent = Player.PlayerGui gui.Name = 'Gui' print'Catch ready, click again to get fish!' CatchReady = true break end wait(0.1) end if x:findFirstChild('BobScript') then x.BobScript:destroy() end x.Rotation = Vector3.new(0,0,0) --= x.CFrame * CFrame.Angles(0,0,0) x.CFrame = x.CFrame * CFrame.new(0,-0.2,0) while debounce do x.CFrame = x.CFrame * CFrame.Angles(0,0.1,0) x.CFrame = x.CFrame * CFrame.new(0.1,0,0) wait() end end)) end function getFish(Tier) local Total = 0 local Table = {} for i,v in pairs(Tier:GetChildren()) do Total = Total + v.Value for i = 1,v.Value do table.insert(Table,v) end end local num = math.random(1,#Table) return Table[num] end function getTier() if Water then local tier = Water.Rarity.Value local Table = {} for i,v in pairs(game.ReplicatedStorage.Fish:getChildren()) do if tonumber(v.Name) <= tier and Tool.Tier.Value >= tonumber(v.Name) then table.insert(Table,v) end end local NewTable = {} for i,v in pairs(Table) do local loop if v.Name == '0' then loop = 1 elseif tonumber(v.Name) == tier then loop = math.ceil(tonumber(v.Name) * 1.5) else loop = tonumber(v.Name) end for i = 1,loop do table.insert(NewTable,v) end end -- for i,v in pairs(NewTable) do -- print(tostring(v)) -- end return getFish(NewTable[math.random(1,#NewTable)]) end end function Catch() cast = false for i,v in pairs(Char:GetChildren()) do if v.Name == 'Delete' then v:destroy() end end Char.RightUpperArm['RightShoulder'].C0 = C0Real if Player.Backpack:findFirstChild('Reel') then Player.Backpack.Reel:Stop() wait() Player.Backpack.Reel:destroy() end if Player.PlayerGui:findFirstChild('Gui') then Player.PlayerGui.Gui:destroy() end if CatchReady then CatchReady = false local Fish = getTier() -- if Player.Backpack:findFirstChild('Reel') then -- Player.Backpack.Reel:Stop() -- wait() -- Player.Backpack.Reel:destroy() -- end local sound = GetMusic(244994347) sound.Looped = false sound.Parent = Player.Character.UpperTorso sound:play() game.Debris:addItem(sound,4) if #Player.Fish:GetChildren() < Player.InventorySpace.Value then workspace.CashHandler.GiveFish:FireServer() local cl = Fish:clone() cl.Parent = Player.Fish if Player.Quests:findFirstChild(cl.Name) then Player.Quests:findFirstChild(cl.Name).Value = Player.Quests:findFirstChild(cl.Name).Value + 1 end displayCatch(cl.Name) else displayCatch('Inventory Full') end end Char.Humanoid.WalkSpeed = 16 end Tool.Equipped:connect(function(m) mouse = m end) Tool.Activated:connect(function() if mouse.Target then if mouse and not debounce and mouse.Target.Name == 'Water' and (Player.Character.UpperTorso.Position - mouse.Hit.p).magnitude <= 100 then debounce = true Water = mouse.Target local success,message if Water:findFirstChild('ChanceIncrease') then if Water.ChanceIncrease.Value == true then success,message = pcall(Swing,mouse.Hit * CFrame.new(0,-0.7,0),true) else success,message = pcall(Swing,mouse.Hit * CFrame.new(0,-0.7,0),false) end else success,message = pcall(Swing,mouse.Hit * CFrame.new(0,-0.7,0),false) end if not success then print(message) script.Disabled = true wait() script.Disabled = false end elseif debounce and cast then Catch() debounce = false end end -- mouse.Target check end)
NEW CODE:
local Tool = script.Parent local debounce = false local mouse local Player = game.Players.LocalPlayer repeat wait() until Player.Character local Char = Player.Character local cast = false local CatchReady = false local Water local CatchPlayer = false local RightShoulder = Char:WaitForChild("RightUpperArm"):WaitForChild("RightShoulder") local C0Real = RightShoulder.C0 function GetMusic(musicID) local music = Instance.new('Sound') music.SoundId = 'rbxassetid://'..musicID return music end function Swing(pos,splash) Char.Humanoid.WalkSpeed = 0 for i = 1,10 do Char.RightUpperArm['RightShoulder'].C0 = Char.RightUpperArm['RightShoulder'].C0 * CFrame.Angles(0,0,0.17) wait() end local sound = GetMusic(244996548) sound.Looped = false sound.Parent = Player.Character.UpperTorso sound:Play() game.Debris:addItem(sound,5) for i = 1,14 do Char.RightUpperArm['RightShoulder'].C0 = Char.RightUpperArm['RightShoulder'].C0 * CFrame.Angles(0,0,-0.17) wait() end CastLine(pos,splash) for i = 1,2*3 do Char.RightUpperArm['RightShoulder'].C0 = Char.RightUpperArm['RightShoulder'].C0 * CFrame.Angles(0,0,0.17/3) wait() end end function displayCatch(name) local cl = game.ReplicatedStorage.DisplayCatch:clone() cl.Parent = Player.Character.Head cl:WaitForChild('TextLabel') cl.TextLabel.Text = name coroutine.resume(coroutine.create(function() for i = 1,100 do cl.StudsOffset = cl.StudsOffset + Vector3.new(0,0.05,0) cl.TextLabel.TextTransparency = cl.TextLabel.TextTransparency + 0.01 cl.TextLabel.TextStrokeTransparency = cl.TextLabel.TextStrokeTransparency + 0.01 wait() end cl:destroy() end)) end function CastLine(pos,splash) cast = true local x = Instance.new('Part',Char) -- Fishing bob local mesh = Instance.new('SpecialMesh',x) mesh.MeshType = Enum.MeshType.Sphere mesh.Scale = Vector3.new(0.6,0.6,0.6) x.Touched:connect(function(part) if part.Parent:findFirstChild('UpperTorso') and not CatchPlayer then CatchPlayer = true part.Parent.UpperTorso.CFrame = Char.UpperTorso.CFrame * CFrame.new(0,0,-1) displayCatch(part.Parent.Name) local sound = GetMusic(244994347) sound.Looped = false sound.Parent = Player.Character.Torso sound:play() game.Debris:addItem(sound,4) wait(1) CatchPlayer = false end end) x.Anchored = true --x.Shape = Enum.PartType.Ball x.FormFactor = Enum.FormFactor.Custom x.Size = Vector3.new(1,1,1) x.CFrame = pos x.BottomSurface = Enum.SurfaceType.Smooth x.TopSurface = Enum.SurfaceType.Smooth local s = script.BobScript:clone() s.Parent = x s.Disabled = false x.Name = 'Delete' local position = x local distance = (position.CFrame.p - Tool.Shoot.CFrame.p).magnitude local rayPart = Instance.new("Part", Char) local mesh = Instance.new('CylinderMesh',rayPart) mesh.Scale = Vector3.new(0.2,1,0.2) rayPart.Name = "Delete" rayPart.Material = Enum.Material.Fabric rayPart.Transparency = 0 rayPart.Anchored = true rayPart.CanCollide = false rayPart.TopSurface = Enum.SurfaceType.Smooth rayPart.BottomSurface = Enum.SurfaceType.Smooth rayPart.formFactor = Enum.FormFactor.Custom rayPart.Size = Vector3.new(0.2, distance, 0.2) rayPart.CFrame = CFrame.new(position.CFrame.p, Tool.Shoot.CFrame.p) * CFrame.new(0, 0, -distance/2) * CFrame.Angles(math.rad(90),0,0) coroutine.resume(coroutine.create(function() while cast do local distance = (position.CFrame.p - Tool.Shoot.CFrame.p).magnitude rayPart.Size = Vector3.new(0.2, distance, 0.2) rayPart.CFrame = CFrame.new(position.CFrame.p, Tool.Shoot.CFrame.p) * CFrame.new(0, 0, -distance/2) * CFrame.Angles(math.rad(90),0,0) wait() end end)) -- print'Catch ready, click again to get fish!' -- CatchReady = true coroutine.resume(coroutine.create(function() for i = 1,10 do if cast then wait(0.1) end end while cast do local ran if splash == true then if Player.Chance.Value*2 > 100 then ran = math.random(100,100) elseif Player.Chance.Value < 80 then ran = math.random(85,100) else ran = math.random(Player.Chance.Value*2,100) end else ran = math.random(script.Chance.Value,100) end if ran == 100 then local sound = GetMusic(248267272) sound.Looped = true sound.Parent = Player.Backpack sound.Name = 'Reel' sound:Play() local gui = game.ReplicatedStorage.CatchNow:clone() gui.Parent = Player.PlayerGui gui.Name = 'Gui' print'Catch ready, click again to get fish!' CatchReady = true break end wait(0.1) end if x:findFirstChild('BobScript') then x.BobScript:destroy() end x.Rotation = Vector3.new(0,0,0) --= x.CFrame * CFrame.Angles(0,0,0) x.CFrame = x.CFrame * CFrame.new(0,-0.2,0) while debounce do x.CFrame = x.CFrame * CFrame.Angles(0,0.1,0) x.CFrame = x.CFrame * CFrame.new(0.1,0,0) wait() end end)) end function getFish(Tier) local Total = 0 local Table = {} for i,v in pairs(Tier:GetChildren()) do Total = Total + v.Value for i = 1,v.Value do table.insert(Table,v) end end local num = math.random(1,#Table) return Table[num] end function getTier() if Water then local tier = Water.Rarity.Value local Table = {} for i,v in pairs(game.ReplicatedStorage.Fish:getChildren()) do if tonumber(v.Name) <= tier and Tool.Tier.Value >= tonumber(v.Name) then table.insert(Table,v) end end local NewTable = {} for i,v in pairs(Table) do local loop if v.Name == '0' then loop = 1 elseif tonumber(v.Name) == tier then loop = math.ceil(tonumber(v.Name) * 1.5) else loop = tonumber(v.Name) end for i = 1,loop do table.insert(NewTable,v) end end -- for i,v in pairs(NewTable) do -- print(tostring(v)) -- end return getFish(NewTable[math.random(1,#NewTable)]) end end function Catch() cast = false for i,v in pairs(Char:GetChildren()) do if v.Name == 'Delete' then v:destroy() end end Char.RightUpperArm['RightShoulder'].C0 = C0Real if Player.Backpack:findFirstChild('Reel') then Player.Backpack.Reel:Stop() wait() Player.Backpack.Reel:destroy() end if Player.PlayerGui:findFirstChild('Gui') then Player.PlayerGui.Gui:destroy() end if CatchReady then CatchReady = false local Fish = getTier() -- if Player.Backpack:findFirstChild('Reel') then -- Player.Backpack.Reel:Stop() -- wait() -- Player.Backpack.Reel:destroy() -- end local sound = GetMusic(244994347) sound.Looped = false sound.Parent = Player.Character.UpperTorso sound:play() game.Debris:addItem(sound,4) if #Player.Fish:GetChildren() < Player.stats.InventorySpace.Value then workspace.CashHandler.GiveFish:FireServer() local cl = Fish:clone() cl.Parent = Player.Fish end else displayCatch('Inventory Full') end Char.Humanoid.WalkSpeed = 16 end Tool.Equipped:connect(function(m) mouse = m end) Tool.Activated:connect(function() if mouse.Target then if mouse and not debounce and mouse.Target.Name == 'Water' and (Player.Character.UpperTorso.Position - mouse.Hit.p).magnitude <= 100 then debounce = true Water = mouse.Target local success,message if Water:findFirstChild('ChanceIncrease') then if Water.ChanceIncrease.Value == true then success,message = pcall(Swing,mouse.Hit * CFrame.new(0,-0.7,0),true) else success,message = pcall(Swing,mouse.Hit * CFrame.new(0,-0.7,0),false) end else success,message = pcall(Swing,mouse.Hit * CFrame.new(0,-0.7,0),false) end if not success then print(message) script.Disabled = true wait() script.Disabled = false end elseif debounce and cast then Catch() debounce = false end end -- mouse.Target check end)