I explain everything in the command bar during the video.
Heres the code for the Rod (ITS SERVERSIDE):
local fsh = false
local kiosk = false
local tool = script.Parent.Parent
local rs = game:GetService("ReplicatedStorage")
local lure = tool.Handle:FindFirstChild("lure")
local st = {"springwater", "Ocean"}
local Fish = require(rs.Module.Fish)
local Story = require(rs.Module.Story)
local Players = game:GetService("Players")
if not lure then
error("Lure not found in the tool!")
return
end
local ropeConstraint = lure:FindFirstChildOfClass("RopeConstraint")
if not ropeConstraint then
error("RopeConstraint not found on the lure!")
return
end
local originalLength = ropeConstraint.Length
local extendedLength = originalLength * 2.5
local extendDuration = 2
local function extendAndRetractRope()
wait(0.1)
ropeConstraint.Length = extendedLength
fsh = true
wait(extendDuration)
if not kiosk then
ropeConstraint.Length = originalLength
fsh = false
ropeConstraint.Enabled = false
end
end
local function onLureClicked()
ropeConstraint.Enabled = true
extendAndRetractRope()
end
script.Parent.Parent.Activated:Connect(onLureClicked)
lure.Touched:Connect(function(part)
if fsh and table.find(st, part.Name) then
lure.Anchored = true
tool.Parent.HumanoidRootPart.Anchored = true
local plr = Players:GetPlayerFromCharacter(tool.Parent)
kiosk = true
_G.Fish(plr, part.Name, tool.Name)
lure.Anchored = false
tool.Parent.HumanoidRootPart.Anchored = false
ropeConstraint.Length = originalLength
fsh = false
kiosk = false
ropeConstraint.Enabled = false
end
end)
(yes i use random variable names)