I am trying to create a shop that opens when a player steps on a part. However, Touched does not seem to be working at all, and I have spent an hour trying different code to get it working; but still have not gotten anywhere.
This is the code that I am currently using:
local part = script.Parent
local function shopOpen(otherPart)
local player = game.Players:FindFirstChild(otherPart.Parent.Name)
if player then
print("player found")
player.PlayerGui.Shop.Enabled = true
end
end
part.Touched:Connect(shopOpen)