Help with paint system!

Hello there!

I’m doing pixel art system for a game well but there is problem with resseting plates back to normal color when mouse is not focused on the part

The problem is I’m resseting all parts except for the part that is player focused, Well this is not working well and I dont know why
here is script:

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

local TweenService = game:GetService("TweenService")

Mouse.Move:Connect(function()
	local MousePointObject = Mouse.Target
	if MousePointObject ~= nil then
		if string.find(MousePointObject.Name,"Plate") then
			TweenService:Create(MousePointObject,TweenInfo.new(0.5),{Color = Color3.fromRGB(255, 102, 189)}):Play()
			for i,v in pairs(MousePointObject.Parent:GetChildren()) do
				if v.Name ~= MousePointObject.Name then
					TweenService:Create(MousePointObject,TweenInfo.new(0.5),{Color = Color3.fromRGB(223, 223, 222)}):Play()
				end
			end
		end
	end
	
end)

Thanks for any help!

1 Like

Whats the problem, is it resetting none of the other plates? Resetting some of them? etc…

The problem is that it resets the plate that player is focused on but as you see I made exception for it

First off you tween mouse point object instead of v

Ohh im stupid thanks for helping me

1 Like