When I step on the part it has a infinite yield for the gui shop to turn visible can someone help?
I believe everything is right with the script but it's probably not I probably made a small error.
Here's the script!
script.Parent.Touched:Connect(function(hit)
local char = hit.Parent
local playerName = char.Name
local player = game.Players[playerName]
local shop = player.PlayerGui:WaitForChild("Shop")
shop.ChooseShop.Visible = true
end)
script.Parent.TouchEnded:Connect(function(hitEnd)
local char = hitEnd.Parent
local playerName = char.Name
local player = game.Players[playerName]
local shop = player.PlayerGui:WaitForChild("Shop")
shop.ChooseShop.Visible = false
end)

3 comments
You cannot access any gui from server
just clone the gui from replicated storage or something to the playergui
The .Touched and .TouchEnded can also spam hundreds of touched and touchended events unless you use a debounce