Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Teleport reception bad request?

Okay I have no idea why it is doing this. In studio it works fine, but in solo mode it says that in the title. There is a textbutton that when you press it,(server script) this script happens

local p = game.Players.LocalPlayer
p.PlayerGui.MapSele.Frame.Enter.MouseButton1Click:connect(function()
	local p = game.Players.LocalPlayer
	local c = p.Character

c.Torso.Anchored = true
		local h = Instance.new("Message",p.PlayerGui)
		h.Text = "Please Wait.."
		p.PlayerGui.MapSele.Frame.Enter.Visible = false
		local TeleportService = game:GetService("TeleportService")
		local level1Id = 932155277
		    
		        TeleportService:Teleport(level1Id, p)
		    
	
end)


but it just says the title in the output. any idea why?

2 comments

0

Is the place active you're trying to teleport them to? Otherwise, I think it would do that.

0

Yes there active and everyone can play

2 answers

Now, I know this has happened to me before, try putting a space so that

Instance.new("Message",p.PlayerGui)

Becomes

Instance.new("Message", p.PlayerGui)

Or it reads the 2 arguments as one.

8 comments

0

actually, thats not the case..

0

Seems like it could work. They're both beginner mistakes so it is rather easy to make either one.

0

i belive the comma seperates aurguments no matter if theres a space or not..

0

plus the most likely answer is that hes using local player in a server script, which is not possible.

0

I did get taught that the space is needed but just be open minded and accept every possibility, no matter the odds.

0

well i have code that has no spaces in between commas and it works fine..

0

I did all of those things, it is now in a server script. But it just says "Invalid player to teleport"

0

game.Player.LocalPlayer only works in local scripts.

Why is this in a server script?? Local player can only be accessed through a local script..

If this fixed your problem pls accept this answer!

This discussion is preserved as it was. New answers, comments, and votes are closed.