I have a teleportation service running in my game where players can be teleported to diffewrant rooms, but the output is saying: Workspace.map.teleporter3.teleport.Script:8 attempt to index local 'Player' (A nil Value) theres no point in putting the rest, because it basically repeats te directory, and it is the same for all three, so i am only putting one. Here is the code:
button = script.Parent
teleportergui = script.teleporterservice1
function onTouch(other)
player = game.Players:GetPlayerFromCharacter(other.Parent)
local tele2gui = teleportergui:clone()
tele2gui.Parent = player.PlayerGui
wait(5)
tele2gui:Destroy()
end
button.Touched:connect(onTouch)
it is supposed to put in a GUI into the player, that you use to choose where to go, but you already know what the output says, so can anyone please help me?

3 comments
You should probably implement debounce into your code a long with checking if other.Parent is actually a character's player mode.
Do you have a place where to learn how to use debounce?
It is actually giving an error code now, saying it cannot index global player.