so i have this script where its suppose to open a Ui thats in the players uis. when i click the ProximityPrompt or press e it wont show the ui.
script.Parent.Triggered:Connect(function() game.Players.LocalPlayer.PlayerGui.Shop.Frame.Visible = true end)
please help.
The correct event is PromptTriggered, not Triggered.
you can easily do a server script for this because the triggered function has a player parameter
script.Parent.Triggered:Connect(function(player) player.PlayerGui.Shop.Frame.Visible = true end)
As far as I can tell from testing your code and my own, one good way of going about this is through the use of RemoteEvents. First we will be creating a Remote Event and putting it in Replicated Storage. Then it is as simple as firing this event from a server script,(the location does not matter as long as the server script knows what you mean by proximity prompt)and creating a local script wherever it works(starterplayer, workspace, etc) and making the frame visible from there
--Server Script local rs = game:GetService("ReplicatedStorage") local ppEvent = rs:WaitForChild("PPEvent") script.Parent.Triggered:Connect(function() ppEvent:FireAllClients() end)
--Local Script local rs = game:GetService("ReplicatedStorage") local ppEvent = rs:WaitForChild("PPEvent") local players = game:GetService("Players") --or game.Players local player = players.LocalPlayer local shopGui = player.PlayerGui:WaitForChild("Shop") local frame = shopGui:WaitForChild("Frame") ppEvent.OnClientEvent:Connect(function() frame.Visible = true end)
Be sure to accept this as your answer if it, is the correct solution of course.