I have a game I'm developing, and I'm making a shop in it for armor and swords. When you enter a region specified by a blue circle, it SHOULD open a gui. It works once, and then doesn't run. It says it's done with the code, but nothing's appearing.
I think it might have something to do with the X script. I'll post it as well.
script.Parent.Touched:Connect(function(hit)
print("Hitted")
if hit.Parent:FindFirstChildWhichIsA("Humanoid")then
print("Human")
local Char = hit.Parent
local function FindChar()
for _,i in pairs(game.Players:GetChildren())do
if i:IsA("Player")then
if i.Character == Char then
i.PlayerGui.ShopGui.Shop.Visible = true
print("ED")
end
end
end
end
FindChar()
end
end)
Now the X:
script.Parent.MouseButton1Click:Connect(function(clk)
script.Parent.Parent.Visible = false
end)
(The X's script is Local)

7 comments
please use :FindFirstChildWhichIsA, it is supposedly better than :FindFirstChildOfClass, by the way it wasnt supposed to change anything it was a suggestion, i was reading the code
Didn't work
wait so, the first code posted is in a server script?
yes
there is a problem here
you cant access playerguis through server scripts you need to use remote events
let me fix the scripts for you and it should work, hold on a minute