Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.