The lines inside 'if workspace.gen1.toolbox.walkto.Touched == true' won't work. The output doesn't give me anything to work with. Does anyone know why this isn't working?
clickDetector.MouseClick:Connect(function() local clicked = true humanoid.WalkToPoint = workspace.gen1.toolbox.walkto.Position if clicked == true then if workspace.gen1.toolbox.walkto.Touched == true then humanoid.WalkSpeed = 0 humanoid.JumpPower = 0 local animTrack = humanoid:LoadAnimation(animation) animTrack:Play() end end end)
Because Touched is an Event, it does not return a boolean, you should connect a function to touched instead
clickDetector.MouseClick:Connect(function() local clicked = true humanoid.WalkToPoint = workspace.gen1.toolbox.walkto.Position if clicked == true then workspace.gen1.toolbox.walkto.Touched:Connect(function() humanoid.WalkSpeed = 0 humanoid.JumpPower = 0 local animTrack = humanoid:LoadAnimation(animation) animTrack:Play() end) end end)
And also your Clicked Boolean is redundant, as the Touched event will only ever be triggered when you Click the ClickDetector. So there really isnt a need to check for "Clicked" unless you are doing it for debouncing