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.
You simply have to remove the ‘platform.BrickColor’ function after the “if platform.BrickColor ~=“ function, so for example.
local button = script.Parent local platform = game.Workspace.Spawn.Platform button.MouseButton1Click:Connect(function() if platform.BrickColor ~= ("Toothpaste") then platform.BrickColor = BrickColor.new("Toothpaste") end end