Hello,
I am extremely new at scripting and I already have a question. How can I change a Variable of Script 1 (_G.colornow = _G.blue) with clicking on a button using the second script?
I have two scripts, the first one defines colors and makes a brick change it's color when it gets clicked:
_G.black = BrickColor.Black()
_G.red = BrickColor.Red()
_G.blue = BrickColor.Blue()
_G.green = BrickColor.Green()
_G.erase = BrickColor.White()
_G.colornow = _G.blue
script.Parent.MouseClick:connect(function()
game.Workspace.Folder.Part.BrickColor = (_G.colornow)
end)
And the second script should change the Variable _G.colornow to one of the colors above when a button is clicked:
script.Parent.MouseButton1Click:connect(function()
--Here I need to change the variable _G.colornow
end)
I already thank you in advance.
Regards, nicolinooAT aka. Nico

2 comments
Use BindableEvents
Use BindableEvents