So I was making a Simulator (you may already know on my first question) I wanted to add a touch event to a MeshPart to open up the Frame. It works but only once for some reason.
The shop script:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
plr.PlayerGui.Shop.Frame.Visible = true
end
end
end)
The rebirth script:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
plr.PlayerGui.Rebirth.Frame.Visible = true
end
end
end)
NOTE: BOTH OF THESE ARE SERVER SCRIPTS
Any help would be appreciated!

2 comments
Thank you! I put the scripts in game.StarterGui and now it works perfectly!
The code: workspace.ShopMesh.Touched:Connect(function(hit) print(hit.Parent) if hit.Parent:FindFirstChild("Humanoid") then script.Parent.Shop.Frame.Visible = true end end)