I have a script, remotefunction, etc. that open a shop when you right click on a part, that works perfectly in studio, but I always get the same errors in-game! Could someone please assist me?
The error I get in-game: https://gyazo.com/c152f5a990f8826a43c92aa69846ce8b
What it should look like when I buy it: https://gyazo.com/0a29e9f208e8e2d37e877904ebfef2db
The code basically opens the menu when the remoteevent is fired and IS STORED IN SERVERSCRIPTSTORAGE
This is the code that is getting the error:
local open= game.ReplicatedStorage.menuEvent open.OnServerEvent:connect(function(plr, id) repeat wait() until plr.PlayerGui.Main~= nil plr.PlayerGui.Main.Frame.Value.Value=id plr.PlayerGui.Main.Frame.Visible=true end)
Client sided (fires the event):
children=workspace.Planets:GetChildren() for i=1, #children do children[i].detect.ClickDetector.RightMouseClick:connect(function() print"db" game.ReplicatedStorage.menuEvent:FireServer(children[i].Name) print"debug" end) end
Please help!
Thanks for the comment, chexy. After reading that I realized how redundant the whole thing was, so I moved it all to clientside and it now works, thank you!
-Green