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

How to change a property of a model using Text Button?

Asked by 4 years ago

My script doesn't work but the for i, color script is a functional part How do I improve and fix this mess.

local violet = script.Parent.Violet
local indigo = script.Parent.Indigo
local blue = script.Parent.Blue
local green = script.Parent.Green
local yellow = script.Parent.Yellow
local orange = script.Parent.Orange
local red = script.Parent.Red
local Color = game.Workspace.FordFusion.Body.Model.Model:GetChildren()
game.Workspace.Detection.Touched:Connect(OnTouch)

--
function OnTouch()
    red.Visible = true
    orange.Visible = true
    yellow.Visible = true
    green.Visible = true
    blue.Visible = true
    indigo.Visible = true
    violet.Visible = true

    violet.MouseButton1Click:Connect(function()
        wait(.1)
        for i, color in pairs (Color) do
            if color.Name == "Color" then
                color.BrickColor = BrickColor.new("Magenta")
            end
        end
    end
    indigo.MouseButton1Click:Connect(function()
        for i, color in pairs (Color) do
            if color.Name == "Color" then
                color.BrickColor = BrickColor.new("Dark Indigo")
            end
        end
    end)
end



0
Is the function OnTouch() supposed to be commented out? Crvnberie 35 — 4y
0
what exacly are you trying to do here with the colours Gameplayer365247v2 1055 — 4y
0
I am trying to change the body of a FordFusion and the colours are the gui's that will change the color of the body TramHammer3772 29 — 4y

Answer this question