- What do you want to achieve? Keep it simple and clear!
Why the part is not moving
- What is the issue? Include screenshots / videos if possible!
I am making a fishing rod where when you click it casts a ball in the direction you click it doesn’t have any welds only a rope attached that I increase length before applying impulse.
local plrs = game:GetService("Players")
local tool = script.Parent
local tip = script.Parent.Tip
local rope = script.Parent.Tip.RopeConstraint
local bobber = script.Parent.bobber
local char = tool.Parent
local myplayer
local mospos = script.Parent:WaitForChild("mospos", 10)
local casted = script.Parent.Casted
local debounce = false
function OnEquip()
debounce = true
myplayer = game:GetService("Players"):GetPlayerFromCharacter(tool.Parent)
rope.Length = 3.5
wait(0.4)
debounce = false
end
function VActivateds(player)
if casted.Value == true then
if debounce then return end
debounce = true
rope.Length = 3.5
wait(0.1)
wait(0.5)
debounce = false
casted.Value = false
elseif casted.Value == false then
if debounce then return end
debounce = true
wait(0.3)
local pos = mospos:InvokeClient(myplayer)
rope.Length = 50
wait(0.1)
local lookdir: Vector3 = CFrame.lookAt(tool.Handle.CFrame.Position, pos).LookVector
local Velocity: Vector3 = lookdir * 1500
bobber:ApplyImpulse(Velocity)
wait(0.5)
debounce = false
casted.Value = true
end
end
tool.Equipped:Connect(OnEquip)
tool.Activated:Connect(VActivateds)