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

How do you 'link' a number value with a property?

Asked by
B3blx 5
9 years ago

By this, I mean that the property goes up once something's added to the value. For example, I tried this:

v.BrickColor.r = script.Parent.RedVal

All help will be appreciated :)

1 answer

Log in to vote
0
Answered by 9 years ago

What I think you mean is that you want a variable that follows a certain property. What you need to do is redefine it. I personally like using the changed event

local propertyvalue = game.Workspace.Part.Name

game.Workspace.Part.Changed:connect(function(prop)
    if prop == "BrickColor" then
        propertyvalue = prop
    end
end)

Do me a favor and mark my answer as right

Ad

Answer this question