Ok made this touch script and I want to know how to make the function skip to end when a sword touched the part and triggers the function ( sorry for bad explaining Idk how else to explain this.)
not the full script
local function onTouched(part)
if part.Parent.Parent:FindFirstChild("Sword") then -- if a sword touched the block then
print("aaa") -- this worked, but how can I make it skip the fucntion
end -- ignores the lines below v
Player = Players:GetPlayerFromCharacter(part.Parent)
if Player and Player.Character then
if debounce == false then
debounce = true
Backpack = Player:WaitForChild("Backpack")
for i = 1, #ToolNames do
local Tool = Storage:FindFirstChild(ToolNames[i])
if Tool then
Tool:clone().Parent = Backpack
tofastman = 2
end
end
end
end
end

2 comments
Thanks, but the debounce is set to false in a different function. The full script is 50+ lines, this is just a part of the whole script.
got it. just making sure, lol.