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

Why doesn't my Local Variables work?

Asked by
Danfly 5
10 years ago

Please ignore the last parts of it.

RegisterMain is a Model, Register01 is a model inside it Cloner is a part inside it Registergui is a screengui A Account is a frame. I want to make it so all the A accounts switches to B account if I add one of these variables in. As this is a model. No I do not want another way I should perform this whole script I just want a variable for it (aka fix the first 2 lines ONLY)

game.Workspace.RegisterMain.Register01.Cloner.RegisterGUI["A Account"] = game.Workspace.RegisterMain.Register01.Cloner.RegisterGUI["B Account"]

function onSelect()
game.Workspace.RegisterMain.Register01.Cloner.RegisterGUI["A Account"]["+10000000"].Visible = true
game.Workspace.RegisterMain.Register01.Cloner.RegisterGUI["A Account"]["+10000000A"].Visible = true
game.Workspace.RegisterMain.Register01.Cloner.RegisterGUI["A Account"]["+5000000"].Visible = true
game.Workspace.RegisterMain.Register01.Cloner.RegisterGUI["A Account"]["+5000000A"].Visible = true
game.Workspace.RegisterMain.Register01.Cloner.RegisterGUI["A Account"]["-10000000"].Visible = true
game.Workspace.RegisterMain.Register01.Cloner.RegisterGUI["A Account"]["-10000000A"].Visible = true
game.Workspace.RegisterMain.Register01.Cloner.RegisterGUI["A Account"]["-5000000"].Visible = true
game.Workspace.RegisterMain.Register01.Cloner.RegisterGUI["A Account"]["-5000000A"].Visible = true
game.Workspace.RegisterMain.Register01.Cloner.RegisterGUI["A Account"]["+5"].Visible = true

end

script.Parent.MouseButton1Click:connect(onSelect)

2 answers

Log in to vote
0
Answered by
Protune 15
10 years ago
local RegisterA = game.Workspace.RegisterMain.Register01.Cloner.RegisterGUI["A Account"]
local RegisterB = game.Workspace.RegisterMain.Register01.Cloner.RegisterGUI["B Account"]

then you can use that.

Example: RegisterA.["+10000000"].Visible = true

0
I dont want Register A and B I want Account A or B Danfly 5 — 10y
0
Variables can have whatever name you want. Tkdriverx 514 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

I am not quite sure I understand your problem. When referring to 'A Accounts', do you mean all A-related frames, or actual players? Be more descriptive, give us an overview of your hierarchy and so. The more information you provide, the easier it is for us to help you.

Answer this question