local tool = script.Parent
local katana = tool.Katana
local db = false
local backpack = tool.Parent
local player = backpack.Parent
local playerStats = player:FindFirstChild("leaderstats")
local playerSliced = playerStats:FindFirstChild("In Backpack")
local playerSpaces = playerStats:FindFirstChild("Space Available")
local function onTouch(partTouched)
local canHarvest = partTouched.Parent:FindFirstChild("CanHarvest")
if canHarvest then
if canHarvest.Value == true and playerSliced.Value < playerSpaces.Value then
playerSliced.Value = playerSliced.Value + 1
canHarvest.Value = false
partTouched.Transparency = 1
partTouched.CanCollide = false
wait(5)
canHarvest.Value = true
partTouched.Transparency = 0
partTouched.CanCollide = true
local function onTouch(partTouched)
if canHarvest then
if canHarvest.Value == true and playerSliced.Value >= playerSpaces.Value then
script.Parent.Handle.Touched:connect(function(Hit)
local player = game.Players:GetPlayerFromCharacter(Hit.Parent)
player.PlayerGui.NES.Frame.Visible = true
wait(2)
player.PlayerGui.NES.Frame.Visible = false
i Dont know why it keeps giving me errors about the script.Parent.Handle.Touched:connect(function(Hit) it says it needs to end but ive tried everything heres the code so far!

1 comment
line 25 is the issue