I have 2 portals that open a TP Gui when touched, there are two separate frames in aScreen Gui. They work-ish, when you go one it worked, but any time after that on any portal it doesn't work... here are my scripts They are global scripts (NOT LOCAL)!
function OnTouched(hit)
game.Players[hit.Parent.Name].PlayerGui.PortalTeleports.SLTP.Visible = true
hit.Parent.HumanoidRootPart.Anchored = true
end
script.Parent.Touched:Connect(OnTouched)
function OnTouched(hit)
game.Players[hit.Parent.Name].PlayerGui.PortalTeleports.MLTP.Visible = true
hit.Parent.HumanoidRootPart.Anchored = true
end
script.Parent.Touched:Connect(OnTouched)
SLTP = Shadowlands TP MLTP = Mainland TP
The two scripts are located in two differant parts, they each open a differant frame, located in the same ScreenGui, when you stand on one portal (dosnt matter which), it opens correct Gui, then if you click yes, then it would TP you to the other area. Then if you stand on the one on the other side, it dosn't work. When i re-enter Test Mode, I go to the other end and that works but then the other dosn't! Can Someone Please Help Me!!!!!!!!!!

3 comments
Are there any errors in your output? If so, tell me them. Also, I would consider using RemoteEvents to make the GUI elements visible.
You need to put it in a localscript in starter gui as you need to contact it via client
use a local script