Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't this mouse target script working? [need answers]

Asked by 7 years ago
tool = script.Parent
mouse = game.Players.LocalPlayer:GetMouse()

tool.Equipped:connect(function(eventMouse)
    if eventMouse.Target == game.Workspace.Baseplate then
        game.Workspace.Baseplate.BrickColor = BrickColor.new("Bright green")
    end
end)

I'm trying to do so that when my mouse hovers over Baseplate then it will change the color to Bright green.

1 answer

Log in to vote
0
Answered by 7 years ago

This is a LocalScript located inside of StarterPlayerScripts. It is NOT a tool, just a script.

local plr = game.Players.LocalPlayer
mouse = plr:GetMouse()

mouse.Move:connect(function()
    local part = mouse.Target
    if part.Name == "Baseplate" then
        part.BrickColor = BrickColor.new("Bright green")
    end
end)

Ad

Answer this question