So I tried to change a parts color using a screen gui script. So I basically try to use a textbutton to change a parts color for a rpg game. This is my script(its a local script)
local button = script.Parent
local platform = game.Workspace.Spawn.Platform
button.MouseButton1Click:Connect(function()
if platform.BrickColor ~= platform.BrickColor("Toothpaste") then
platform.BrickColor = BrickColor.new("Toothpaste")
end
end)
Please help me and tell me whats wrong.

2 comments
I believe you simply need to remove 'platform.BrickColor' after the not equals and put 'if platform.BrickColor ~= ("Toothpaste")'. I've tested this with a Touched event and it seems to work.
Thank you for your help it really helped me in developing my game, I hope you have a nice day.