No errors anywhere yet function still doesn't work

Hello, so I have this script meant to do all the things in the following function, but it’s not working. It doesn’t even print “worked?”. There’s nothing wrong in the output, and I’ve even asked the AI and it is just sending my exact same code word for word again. The code is in a LocalScript if that changes anything. Any help?

Screenshot 2024-12-27 201517

local axemesh = script.Parent
local keysound = game.Workspace.keysound
local walldet = game.Workspace:WaitForChild(“clickingpart”):WaitForChild(“ClickDetector”)
local clickdet = axemesh:WaitForChild(“ClickDetector”)

local function axecollect()
print(“worked?”)
task.wait()
keysound:Play()
task.wait()
walldet.MaxActivationDistance = 10
task.wait()
axemesh:Destroy()
end

clickdet.MouseClick:Connect(axecollect)

LocalScripts don’t run in the Workspace

Local scripts do not work in the workspace, they only work in players and playercharacters. A full list of the places where local scripts run is here: Data Model | Documentation - Roblox Creator Hub

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.