So... In one of my games, I work with a teleport system, so if a player touches an invisible brick, he will be teleported to the place that's in the script in the part. But... I also want to make an ImageLabel in a ScreenGui in the StarterGui pop up when the player touches the brick, saying that he's being teleported. I tried to get in this Gui using the 'players' thing in the game, but I'm kinda stuck with the script... Can someone help me or show me another way to do this? Thanks a lot.
This is the script I made:
local TeleportService = game:GetService("TeleportService")
local gameID = 2198621137
function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
TeleportService:Teleport(gameID, player)
game.Players."I'm stuck here".PlayerGui.Revolution2004.ImageLabel.Visible = true
print("Teleporting to Revolution 2004...")
end
end
script.Parent.Touched:connect(onTouched)
? "Revolution2004" is the name of the ScreenGui

8 comments
Thank you so much! At first, it didn't seem to work, but I found out that this had something to do with a property of the ScreenGui called 'IgnoreGuiInset'. Everything is working perfectly now!
:D
Well at least it worked in Studio, It doesn't seem to work in the actual game OwO
Is the game filtering enabled?
Yeah
Try putting a local script in startergui and at the bottom change it to the location of the brick
Thank you it worked ^^
<3