#deleted

17 messages · Page 1 of 1 (latest)

feral kraken
#

✔ The Tool must have a "Handle"

✔ The "Handle" must not be anchored

✔ Use a ClickDetector if clicking directly on a part

✔ Use Tool.Activated if clicking while holding the tool

#

✅ 4. Use Activated Instead of ClickDetector (For Equippable Tools)

#

If the tool is equipped but the attack isn’t working, use Tool.Activated instead of ClickDetector:

#

code to fix using Activated:

local tool = script.Parent

tool.Activated:Connect(function()
print("Tool was clicked while equipped!")
end)

#

i just try these steps lets see if it solve:

upper mantle
#

im confused

#

what is this

split cove
#

wth

#

why does this look like bot wrote this

feral kraken
#

@split cove These are some solutions to my problem that took ages to solve

terse crownBOT
#

studio** You are now Level 6! **studio

feral kraken
#

i just try Activated

feral kraken
#

✔ Use Tool.Activated if clicking while holding the tool

#

i need to run on the script not in console

#

error in console:

06:47:28 -- console:1: attempt to inex nil with 'Parent'
06:47:28 -- Stack Begin
06:47:28 -- Script 'console', Line 1
06:47:28 -- Stack End

#

fixed code to error on StarterPlayerScripts LocalScript:

local player = game.Players.LocalPlayer
local UserInputService = game:GetService("UserInputService") -- Corrected variable name
local camera = workspace.CurrentCamera

UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.MouseButton1 and not gameProcessedEvent then
local mousePosition = UserInputService:GetMouseLocation()
local ray = camera:ScreenPointToRay(mousePosition.X, mousePosition.Y)
local hit = workspace:FindPartOnRay(ray)

    if hit then
        print("Mouse clicked at position: " .. tostring(hit.Position))
    end
end

end)

error in console:

07:14:14 -- console:5: Incomplete statement: expected assignment or a function call