Failing Transition GUI

Hey everyone! Before I get into the basics, my game is coming to a close into Beta, so all of the scripts that our team can’t solve get opinions here! This is why I’m posting so frequently atm.

So Yesterday I started scripting portals in our game, where if you walk into one it has a transition gui, and whilst the gui is covering the screen the player teleports. Well, basically everytime any player in the server walks into a portal, everyone has the gui pop up and everyone is teleported.

I know this has something to do with Local Player, but I put that into all the scripts and used a LocalScript as well, so I don’t get what’s going on with it!

This is the layout of sectors that might be needed to see:
Screenshot_608 Screenshot_609

The script consists of this: (Note that above this line involves local portal = game.Workspace.Islands.Islands.UpperIslands.TheCastle.Portal.SpawnPortal.SpawnPortal.Portal

portal.Touched:Connect(function(hit)
	local player = game.Players.LocalPlayer.Character
	local pos = workspace.TPLocations.Castle:FindFirstChild("CastleBack") -- Above. This CastleBack is in the Folder Castle. (This is where you end up after going back through the portal.)
script.Parent.Gui:TweenPosition(UDim2.new(0.5,0,0.5,0), "Out", "Sine", 0.8) -- Gui moves across screen
script.Parent.Gui.Visible = true -- Possible Fault, probably not needed.
wait(1.2)
player:MoveTo(pos.Position) -- Moves player to CastleBack position
wait(0.6)
script.Parent.Gui:TweenPosition(UDim2.new(3,0,0.5,0), "In", "Sine", 0.8) -- Reverses the GUI.
wait(1.2)
script.Parent.Gui.Visible = false -- Also probably not needed.

end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

The event fires any time the portal is touched, whether it’s you or somebody else. You need to add a condition that the hit part belongs to your character. Maybe something like

if hit:IsDescendantOf(game.Players.LocalPlayer.Character) then

assuming that the Character exists.

1 Like

I’ll test it out now. If it doesn’t work, got any other suggestions to make it Local?