The local script is supposed to fire an event which will then be picked up by a server script which will then tween a frame into its position
Local Script: Located in StarterGui
local cd = game.Workspace.shopclick.ClickDetector local event = game.ReplicatedStorage.OpenShop cd.MouseClick:Connect(function() event:FireServer() end)
Server Script: Located in StarterGui
local event = game.ReplicatedStorage.OpenShop event.OnServerEvent:Connect(function(Player) local frame = script.Parent.Parent.PlayerGui.Main.Shop_UI frame:TweenPosition(UDim2.new(0.359, 0,0.307, -19), 'Out', 'Back', 1) end)
I get no errors in the output, and I'm wondering if it's because PlayerGui isn't accessible by the client...
It works fine in PlaySolo but I know that disregards FilteringEnabled...
You can't access things inside of a player's player GUI and have it affect the player from a server script.. It has to be a local script to make changes to the player's client. Whenever testing it's best to test with a test server in studio rather than play solo.
Unfortunately you have your scripts a little backward.
Server scripts can't access PlayerGui, so anything that edits the GUI will have to be done in LocalScripts. Keep in mind you can use RemoteEvents not only to go from client to server, but also vice versa.
ClickDetectors must be handled by server scripts. You could insert one into a part and connect the RemoteEvent that edits the PlayerGui to the MouseClick event.
Edit:
LocalScript
local event = game.ReplicatedStorage.OpenShop event.OnClientEvent:Connect(function() --Tween your frame here end)
Server Script
local cd = game.Workspace.shopclick.ClickDetector local event = game.ReplicatedStorage.OpenShop cd.MouseClick:Connect(function(player) event.FireClient(player) end)
I recommend putting the LocalScript somewhere inside StarterGui so that it gets cloned to PlayerGui when a player's character spawns in and you won't have to reference PlayerGui inside your script. The server script also needs to be inside the part or model that's receiving the click.