So lately i have been trying to learn roblox scripting and i have come pretty far (i think) and i have been trying to make a DBZ game in roblox but i am still learning so i wanted to make a filtering enabled compatible screen gui that when clicked opens up another screen gui for the client or player like a shop, when i was scripting i made a RemoteEvent and i duplicated that one and made another one named "GameEvent". Well the reason to make two RemoteEvents was well you will see it later......
Mainly I made 2 RemoteEvents inside of ReplicatedStorage and then i made a screen gui inside of starter gui and inside of the screen gui i put a TextButton naming it "ShopOpen"and a Local Script inside of TextButton. Like this if you didn't understand that = ScreenGui.ShopOpen.LocalScript
And I Put This Inside Of The Local Script:-
script.Parent.MouseClick1Button:Connect(function()
game.ReplicatedStorage.RemoteEvent:FireServer()
end)
And now i made another ScreenGui naming it "SHOP" this time and inside of that i put a Frame and inside of that i put a TextButton Named "XBUTTON" where it just displays "X" as a font and making it such a size that it looks just like the windows exit button. And now inside of the XBUTTON I Put a Local Script. Like this if you didn't understand that = SHOP.Frame.XBUTTON.LocalScript
And I Put This Inside Of The Local Script:-
script.Parent.MouseClick1Button:Connect(function()
game.ReplicatedStorage.GameEvent:FireServer()
end)
Then I Dragged "SHOP" Into ServerStorage So I Could Clone() It Into The Player's PlayerGui Folder. And I Made The "XBUTTON" So That I Could Destroy That Made "SHOP" Clone Inside Of The Player's PlayerGui Folder
I Don't Know Why I Made Two RemoteEvents (Maybe To Seperate The Two Scripts From Getting Confused?)
And when i finished That i made two scripts in the ServerScriptService naming the first one "RemoteEventListener" and the other one "GameEventListener".
I Put This Inside Of RemoteEventListener:-
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function()
local shop = game:GetService("ServerStorage"):WaitForChild("SHOP")
local plr = game.Players.LocalPlayer
shop:Clone().Parent = plr.PlayerGui
end)
And This Inside Of GameEventListener:-
game.ReplicatedStorage.GameEvent.OnServerEvent:Connect(function()
local plr = game.Players.LocalPlayer
plr.PlayerGui.SHOP:Destroy()
end)
What This Does Is When The Client Or Player Clicks It On The Client Or Player Screen It Opens A Pop Up Screen Gui Which Shows The Shop. When I Tested It Inside Of Roblox Studio It Worked Just Fine, But When I Played It With The Actual Roblox Player It Didn't Even Show Up!! And I Have Already Tried Using The Method Where The Frame Inside Of The ScreenGui Is On The Clients Screen But It Is Not Visible Only When The Shop Button Is Clicked Visible is turned on and the XBUTTON When Clicked Closes or Makes Visible = false But Yet Again When I Test It Using The Studio Itself It works just fine but when i try to play it with Roblox Player It Gives Out On Me!! Pls Help ------------------------------------------
