I’m currently making a system where if a player touches a part, a gui shows on their screen. This is my code:
local Brick = script.Parent
local shopGuiRemoteEvent = game.ReplicatedStorage.ShowShopGui
local Players = game:GetService('Players')
--End--
--Code--
local function PlayerTouched(player,Part)
print('touched')
shopGuiRemoteEvent:FireClient(player)
print('fired')
end
Brick.Touched:Connect(PlayerTouched)
It comes up with this error:
FireClient: player argument must be a Player object
Even though I already specified the player argument here.
local function PlayerTouched(player,Part)
print('touched')
shopGuiRemoteEvent:FireClient(player)
print('fired')
end
Why is this happening?