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
local rs = game:GetService("ReplicatedStorage")
local ppEvent = rs:WaitForChild("PPEvent")
script.Parent.Triggered:Connect(function()
ppEvent:FireAllClients()
end)
local rs = game:GetService("ReplicatedStorage")
local ppEvent = rs:WaitForChild("PPEvent")
local players = game:GetService("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.
3 comments
Instead of putting the script in the ProximityPrompt, put the script in the part.
And then change the 1st part to "script.Parent.PROXIMITYNAMEHERE.Triggered:Connect(function()" (Also sorry for the seperate messages, I pressed enter accidently.) If that doesn't work, try doing a script instead of a LocalScript and put an argument in the top part. Then change the code in the 2nd line to "local Clone = script.PUTURGUIHERE:Clone()", Clone.Parent = player.PlayerGui
Sorry for being bad at explaining, I tried my best ¯_(?)_/¯