Attempt to call missing method setteleportgui of string

I have a remote event in my game that when fired will set the teleportgui of a local user. This is because i have multiple exits in my games that will teleport you to different places, but the thing is, every time i use the remote event it gives the error shown in the title.

I fire the event using the code below (v is the player instance in game.Players btw)

game.ReplicatedStorage.SetTeleportGui:FireClient(v, escapeguione)

This is the code for the onclientevent

game.ReplicatedStorage.SetTeleportGui.OnClientEvent:Connect(function(escapegui)
    game:GetService("TeleportService"):SetTeleportGui(escapegui)
end)

For the first code that fires the event, escapeguione is a screengui in replicatedstorage which i access using lua local escapeguione = replicatedstorage:WaitForChild("EscapeGuiOne")

If i just use :SetTeleportGui() normally without putting it in a remote event, it will work, but I will need more than one teleport gui

The error doesn’t make sense for the lines of code provided. Can you please provide a screenshot of the error (plus the traceback text - the light blue text), as well as a larger code sample?

The error isnt seeming to appear now, but it still doesnt make the gui appear.

larger code sample:

for i, v in pairs(game.Players:GetPlayers()) do
			if v.Character:WaitForChild("Colony").Value == colony.Value and colony.Value ~= "" then
					table.insert(arrayofplayers, v)

					teleportdata[v.Name] = {v.Name}
					for i, v in pairs(teleportdata) do
						print(v)
					end

					table.insert(teleportdata[v.Name], v.Character.Colony.Value)
					table.insert(teleportdata[v.Name], v.Character.Hunger.Value)
					table.insert(teleportdata[v.Name], v.Character.Thirst.Value)
					table.insert(teleportdata[v.Name], v.Character.Humanoid.Health)
					table.insert(teleportdata[v.Name], v.Character.Humanoid.MaxHealth)
					table.insert(teleportdata[v.Name], game.ReplicatedStorage.ColonyStuff[v.Character.Colony.Value].ColonyLeaderValue.Value)
					table.insert(teleportdata[v.Name], game.ReplicatedStorage.ColonyStuff[v.Character.Colony.Value].MemberPermsFolder.MembersCanExit.Value)
					table.insert(teleportdata[v.Name], game.ReplicatedStorage.ColonyStuff[v.Character.Colony.Value].MemberPermsFolder.MembersCanInvite.Value)
					
					--
				game.ReplicatedStorage.SetTeleportGui:FireClient(v, escapeguione)
				--
					--teleportdata[v.Name].VColonyValue = v.Character.Colony.Value

					for i, v in pairs(teleportdata) do
						print(v)
						--for e, t in pairs(teleportdata[v.Name]) do
						--print(t)
						--end
					end
					


			end
		end

The code above and below the :fireclient() works
I don’t know what you mean by traceback text and light blue text

When @SeargentAUS says:

he is referring to the blue text usually underneath the error message that helps you debug your code but it may not appear if there is no error message.

1 Like