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

ScreenGui buttons malfunction in Play Mode,HELP ?

Asked by 7 years ago
Edited 7 years ago

I've tried to search the web for this issue, but haven't found any help for that... The problem is that my ScreenGui buttons work fine and function in 'Edit Mode's 'Test Mode' But once I go to play the real game, the buttons do not function... I have no idea what I'm supposed to do to fix it so I hope that one of you will help me,please !

game.StarterGui.ScreenGui.Background.MENU.1P.LocalScript

01Button = script.Parent
02OneP = script.Parent.Parent.Parent.TAB.OneP
03TwoP = script.Parent.Parent.Parent.TAB.TwoP
04SPECIAL = script.Parent.Parent.Parent.TAB.SPECIAL
05CART = script.Parent.Parent.Parent.STAB.CART
06ART = script.Parent.Parent.Parent.STAB.ART
07SCRIPTERS = script.Parent.Parent.Parent.STAB.SCRIPTERS
08IDEAS = script.Parent.Parent.Parent.STAB.IDEAS
09 
10Button.MouseButton1Click:connect(function()
11    OneP.Visible = true
12    TwoP.Visible = false
13    SPECIAL.Visible = false
14    CART.Visible = false
15    ART.Visible = false
16    SCRIPTERS.Visible = false
17    IDEAS.Visible = false
18end)
0
How can I make so I could save the script commands correctly unlike it looks right now... ? LordTechet 53 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

EDIT: You forgot the local ;/ here u go:

01local Button = script.Parent
02local OneP = script.Parent.Parent.Parent.TAB.OneP
03local TwoP = script.Parent.Parent.Parent.TAB.TwoP
04local SPECIAL = script.Parent.Parent.Parent.TAB.SPECIAL
05local CART = script.Parent.Parent.Parent.STAB.CART
06local ART = script.Parent.Parent.Parent.STAB.ART
07local SCRIPTERS = script.Parent.Parent.Parent.STAB.SCRIPTERS
08local IDEAS = script.Parent.Parent.Parent.STAB.IDEAS
09 
10Button.MouseButton1Click:connect(function()
11    OneP.Visible = true
12    TwoP.Visible = false
13    SPECIAL.Visible = false
14    CART.Visible = false
15    ART.Visible = false
16    SCRIPTERS.Visible = false
17    IDEAS.Visible = false
18end)
Ad

Answer this question