Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Teleport reception bad request?

Asked by 6 years ago

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?

0
Is the place active you're trying to teleport them to? Otherwise, I think it would do that. hiimgoodpack 2009 — 6y
0
Yes there active and everyone can play goldenshuriken56 0 — 6y

2 answers

Log in to vote
0
Answered by
commag 228 Moderation Voter
6 years ago

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.

0
actually, thats not the case.. outlook1234567890 115 — 6y
0
Seems like it could work. They're both beginner mistakes so it is rather easy to make either one. commag 228 — 6y
0
i belive the comma seperates aurguments no matter if theres a space or not.. outlook1234567890 115 — 6y
0
plus the most likely answer is that hes using local player in a server script, which is not possible. outlook1234567890 115 — 6y
View all comments (4 more)
0
I did get taught that the space is needed but just be open minded and accept every possibility, no matter the odds. commag 228 — 6y
0
well i have code that has no spaces in between commas and it works fine.. outlook1234567890 115 — 6y
0
I did all of those things, it is now in a server script. But it just says "Invalid player to teleport" goldenshuriken56 0 — 6y
0
game.Player.LocalPlayer only works in local scripts. commag 228 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

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!

Answer this question