I have asked this question before but I did not get a good answer. I'm trying to create a store GUI for a game I am making. When I am clicking a ImageButton (This is all scripted) It changes to a new page in studio and works fine. But when I am in the real game, it's not working. I checked the developer console but I didn't find useful information. This has been the problem in the past also and I have not fixed it. Here is a link to the GUI. https://www.roblox.com/library/523645731/ScriptingHelpers-Store-GUI
i got this script from the other question. if it's the same. i changed the player
i did this here so if something is missing (like an end), you can add it
also if you was using a local script, you wont need a local script for this script below
changed the code
local Players = game:GetService("Players") function onPlayerAdded(player) print(player.Name .. " has entered the game") local gui = player.PlayerGui local Store = gui.Store -- Don't use parent just put the gui in StarterGUI local StoreBut = Store.StoreBut local MainBack = Store.MainBack local Trails = Store.Trails local Hats = Store.Hats local Guns = Store.Guns MainBack.HatsButton.MouseButton1Click:connect(function() -- Use MouseButton1Click MainBack.Visible = false Hats.Visible = true end) MainBack.SnipersButton.MouseButton1Click:connect(function() -- Use MouseButton1Click MainBack.Visible = false Guns.Visible = true end) MainBack.EffectsButton.MouseButton1Click:connect(function() -- Use MouseButton1Click MainBack.Visible = false Trails.Visible = true end) Hats.Exit.MouseButton1Click:connect(function() Hats.Visible = false MainBack.Visible = true end) Guns.Exit.MouseButton1Click:connect(function() Guns.Visible = false MainBack.Visible = true end) Trails.Exit.MouseButton1Click:connect(function() Trails.Visible = false MainBack.Visible = true end) Hats.Exit.MouseButton1Click:connect(function() Hats.Visible = false MainBack.Visible = true end) Guns.Exit.MouseButton1Click:connect(function() Guns.Visible = false MainBack.Visible = true end) MainBack.Exit.MouseButton1Click:connect(function() MainBack.Visible = false StoreBut.Visible = true end) StoreBut.TextButton.MouseButton1Click:connect(function() MainBack.Visible = true StoreBut.Visible = false end) end --When a player joins, call the onPlayerAdded function Players.PlayerAdded:connect(onPlayerAdded) --Call onPlayerAdded for each player already in the game for _,player in pairs(Players:GetPlayers()) do onPlayerAdded(player) end