Simple Script Help

okay so im making this script for my simulator, i want it to print what the player clicked while holding the tool so i can use an if statement like: If Part.Name == “Rock” then ect, but for some reason this simple script wont work, please help!

local tool = script.Parent

local function onActivated()
    local mouse = game.Players.LocalPlayer:GetMouse()
    local mouseTarget = mouse.Target

    if mouseTarget and mouseTarget:IsA("BasePart") then


What about the script doesn’t work? Because I put this exact code into a LocalScript under a tool and it worked perfectly as intended.

wait what? really? nothing prints for me

Are there any showing up in the output window?

oh! i forgot to add a Handle, my bad thanks for the help, just me being stupid

1 Like