Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why doesn't my Local Variables work?

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

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

2 comments

0

I dont want Register A and B I want Account A or B

0

Variables can have whatever name you want.

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.