|
| 02 Mar 2015 06:40 AM |
Every time I use this method with a valid userId it always returns the following:
false, "HTTP 403 (Forbidden)", (some random PlaceId)
Does anyone know the reason why this is happening to me? Is it me or is it something else because I feel like its Roblox.
Also here's the snippet where the method is used (this is inside a LocalScript)
local function attemptJoin() local success,errormsg,placeId,instanceId = transport:GetPlayerPlaceInstanceAsync(tonumber(userid)) if not success or placeId == placeIds.hub then global.signal.warning:fire("Player not in Building Universe"..(success and "" or ": "..errormsg)) join.Text = "Join" canRespond = true return end if placeId ~= (stype and placeIds[stype] or placeIds.public) then global.signal.warning:fire("The player was not detected in the requested server type.") join.Text = "Join" canRespond = true return end join.Text = "Working..." transport:TeleportToPlaceInstance(stype and placeIds[stype] or placeIds.public,instanceId) end
-Was Here |
|
|
| Report Abuse |
|
|
| |
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
| |
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 02 Mar 2015 07:25 AM |
| Your trying to see if you can teleport other players or the player itself into a building universe or the same instance of the server? |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 02 Mar 2015 07:40 AM |
| Umm, I don't think you need tonumber(userid), unless it's in string form already. |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 02 Mar 2015 07:44 AM |
| Do you know exactly what line? |
|
|
| Report Abuse |
|
|
|
| 02 Mar 2015 08:37 AM |
Hey Hex, I had a feeling you'd reply :D
What it does is teleports a player to the non-Private Building Server instance the requested player is in (if it is one).
This function runs after the system figures out the userId of the requested player (is either given by "follow by userId" method or I send a http GET reqeust to http://rproxy.pw/rapi/GetIdByUsername/[inputted name here] when they decide to follow by name)
Do you want me to post more code?
-Was Here |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 02 Mar 2015 08:51 AM |
Post the lines of code where you define what the user ID , that would be very helpful.
If you only told me you used rproxy API , q.q |
|
|
| Report Abuse |
|
|
|
| 02 Mar 2015 09:00 AM |
Here's the entire function for you to work with, I have to go to school now
function defaultJoinProcess(self,button,stype) button.MouseButton1Click:connect(function() local frame = gBin.Public:Clone() local canRespond = true local followType = "User ID" local type = frame.Types local follow = frame.TypeContent.FollowFriend local random = frame.TypeContent.Random do local opt1 = follow.Main.Opt1.Button local opt2 = follow.Main.Opt2.Button local box = follow.Main.TextBox local join = follow.Join opt1.MouseButton1Click:connect(function() followType = "Name" if not canRespond then return end opt2.Checked.Visible = false opt1.Checked.Visible = true box.Label.Text = "Name" end) opt2.MouseButton1Click:connect(function() followType = "User ID" if not canRespond then return end opt1.Checked.Visible = false opt2.Checked.Visible = true box.Label.Text = "User ID" end) local function Join() if not canRespond then return end canRespond = false join.Text = "Trying..." local userid = box.Text -- DEFINED HERE local function attemptJoin() local success,errormsg,placeId,instanceId = transport:GetPlayerPlaceInstanceAsync(tonumber(userid)) print(success,errormsg,placeId,instanceId) if not success or placeId == placeIds.hub then global.signal.warning:fire("Player not in Building Universe"..(success and "" or ": "..errormsg)) join.Text = "Join" canRespond = true return end if placeId ~= (stype and placeIds[stype] or placeIds.public) then global.signal.warning:fire("The player was not detected in the requested server type.") join.Text = "Join" canRespond = true return end join.Text = "Working..." transport:TeleportToPlaceInstance(stype and placeIds[stype] or placeIds.public,instanceId) end if followType == "User ID" then if userid:match("%d+") ~= userid then global.signal.warning:fire("Invalid User ID") join.Text = "Join" canRespond = true return end attemptJoin() elseif followType == "Name" then if userid:match("%w+") ~= userid then global.signal.warning:fire("Invalid Username") join.Text = "Join" canRespond = true return end userid = serverService.ReturnUserId:InvokeServer(userid) if userid then attemptJoin() else global.signal.warning:fire("Invalid Username") join.Text = "Join" canRespond = true return end end end animateBorders(join).MouseButton1Click:connect(Join) box.FocusLost:connect(function(entpressed) if entpressed then Join() end end) end do animateBorders(random.Join).MouseButton1Click:connect(function() random.Join.Text = "Working..." transport:Teleport(stype and placeIds[stype] or placeIds.public) end) end type.Random.MouseButton1Click:connect(function() if not canRespond then return end follow.Visible = false random.Visible = true type.Follow.BackgroundTransparency = 1 type.Random.BackgroundTransparency = .9 end) type.Follow.MouseButton1Click:connect(function() if not canRespond then return end random.Visible = false follow.Visible = true type.Random.BackgroundTransparency = 1 type.Follow.BackgroundTransparency = .9 end) displayContent(frame) end) end
-Was Here |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 02 Mar 2015 11:45 AM |
| I'm going to answer this at home. k C: |
|
|
| Report Abuse |
|
|
| |
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 04 Mar 2015 07:28 AM |
lost this forum post for 1 1/2 days...
Figured out you can sort by days :/ |
|
|
| Report Abuse |
|
|
OllieW924
|
  |
| Joined: 17 Dec 2011 |
| Total Posts: 22 |
|
|
| 17 Apr 2015 12:26 PM |
| I get this exact same message and it drives me mad, I use http (http://api-quenty.rhcloud.com/username) and the user ID returns correctly yet I still get HTTP 403 (Forbidden). |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Apr 2017 12:00 AM |
| Sorry for bumping a dead thread, but I've been looking for a fix to this glitch for the whole day today. I've seen other threads similar to this one, but they don't offer an solutions either :/ |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2017 12:01 AM |
^
is it in the real game?
is it a local script?
capitalist atheist |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 10 Apr 2017 01:16 AM |
"Will not return the correct instanceId or will error if used with the userId of a Player not inside the Game of the place where the method is called."
|
|
|
| Report Abuse |
|
|
|
| 10 Apr 2017 08:11 PM |
| OOHHHHh, so are you saying that to determine if a person is in the Game universe, you would just see if it errors or not? |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2017 08:13 PM |
Nope, still didn't work. Here's my RemoteFunction script.
GetFriends.OnServerInvoke = function(Player,Friends) local ReturnTab = {} if #(Friends) == 0 then return "No friends online" else for i = 1,#Friends do local id = Friends[i]["VisitorId"] local success, errorMsg, placeId, instanceId = game:GetService("TeleportService"):GetPlayerPlaceInstanceAsync(id) if success then table.insert(ReturnTab,id) table.insert(ReturnTab,game.Players:GetNameFromUserIdAsync(id)) end end if #(ReturnTab) == 0 then return "No friends online" end return ReturnTab end end |
|
|
| Report Abuse |
|
|
| |
|