im trying to assign the position of a part to a clone that appears later in the script
when i put the if pin == false infront of the if pin part then it doesnt work
also the script repeats destroying the vectorforce and i cant figure out how to only do it once
tool.Activated:Connect(function()
if pin then
pin = false
tool.modle["Thin Torus 2"]:BreakJoints()
for count = 0,timah,.1 do
wait(.1)
timah -=.1
end
local kablooey = Instance.new("Part")
kablooey.Shape = Enum.PartType.Ball
kablooey.CanCollide = false
kablooey.Anchored = true
kablooey.Size = Vector3.new(boomsize,boomsize,boomsize)
kablooey.Color = Color3.new(1,.3,0)
kablooey.Transparency = .6
if thrown == false then
kablooey.Position = script.Parent.Handle.Position
elseif thrown == true then
kablooey.Position = clone.Handle.Position
end
kablooey.Parent = workspace
game.Debris:AddItem(kablooey,.4)
kablooey.Touched:Connect(function(targ)
local human = getHuman(targ)
if human then
human.Health -= (((human.Parent.PrimaryPart.Position - kablooey.Position).Magnitude)) * damage
end
end)
end
if pin == false then
thrown = true
local clone = game.ReplicatedStorage.he:Clone()
local CF = tool.modle.tart:GetPivot()
clone:PivotTo(CF * CFrame.Angles(math.pi/2, 0, 0))
clone.Parent = workspace
clone.Handle.Touched:Connect(function()
wait(.1)
clone.Ball.VectorForce:Destroy()
end)
end
end)
That means that either you don’t have an object called Handle on the cloned object, or that you destroyed your clone object somehow, try to check for that.