ok so im making a shop and the player has to step on this part in the workspace and that acctivates a remote event stored in replicated storage and then i have a script that on the activation that will make the gui visible. but it is not working here are the scripts
script in a part in the workspace: script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
game.ReplicatedStorage.OpenShop:FireClient(player)
end
end)
script in the script service detecting the remote event and making gui apear
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local OpenShop = ReplicatedStorage.OpenShop
OpenShop.OnServerEvent:Connect(function()
game.player.ScreenGui.PlayerUI.GameShopFrame.Visible = true
end)
dont know how to fix this because im pretty bad at scripting

2 comments
You need to send the player through the event and the proper hierarchy is game.Players[player.Name].PlayerGui.
why r u making this with a remote event? making it with remote event is like saying "i want everyone to see this change", just use a local script on it that gives the gui