local RodStats = game:GetService("ReplicatedStorage"):FindFirstChild("RodStats")
local Stats = require(RodStats)
local Fished = game:GetService("ReplicatedStorage"):FindFirstChild("Fished")
Fished.OnServerEvent:Connect(function(plr, mousepos, fishingRod, Rope)
Rope.WinchEnabled = true
local projectile = Stats[fishingRod.Name].Projectile
local pp = plr.Character[fishingRod.Name]:FindFirstChild(projectile)
local hrpp = plr.Character:FindFirstChild("HumanoidRootPart").Position
-- Lenghtening Function
local function Lengthen()
Rope.WinchSpeed = 100
Rope.WinchTarget = Stats[fishingRod.Name].Range
end
pp.Touched:Connect(function(hit)
local character = hit.Parent
local player = game.Players:GetPlayerFromCharacter(character)
if player then
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
-- actions on the player
end
end
end)
local function Shorten()
task.spawn(function()
Rope.WinchSpeed = 100
Rope.WinchForce = 10000
Rope.WinchTarget = 1.4
while Rope.Length >= 1.3 do
task.wait(0.05)
end
Rope.WinchSpeed = 0
Rope.WinchForce = 0
print("stopped")
end)
end
Shorten()