I want a remote event to fire when a player touches an object but it does not fire and I am getting no errors.
-- Local script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local OpenShopGuiEvent = ReplicatedStorage:WaitForChild("OpenShopGuiEvent")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local playerGui = player:WaitForChold("PlayerGui")
local function onOpenShopGuiFired(player)
print(player.Name.." opened the shop")
if playerGui.AdvancedShopGUi.MainShopFrame.Visible~=true then
playerGui.AdvancedShopGUi.MainShopFrame.Visible = true
end
end
OpenShopGuiEvent.OnClientEvent:Connect(onOpenShopGuiFired)
-- Server script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local OpenShopGuiEvent = ReplicatedStorage:WaitForChild("OpenShopGuiEvent")
m = require(game:GetService("ServerScriptService").MainModule)
function touch(hit)
print("Touched")
OpenShopGuiEvent:FireClient(game.Players[m.PlayerName])
end
script.Parent.Touched:Connect(touch)

4 comments
You’re calling FireClient on the client, will error.
What do you mean? @incapaz
"game.StarterGui.AdvancedShopGUi.Parent = playerGui" is redundant, as all objects within the StarterGui are automatically replicated to the PlayerGui.
Incapaz, I was confused as well because he's put both scripts in one code block, but he's used comments to separate them instead.