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

How do I check that the player joining the reserved server actually reserved it?

Asked by 4 years ago
Edited 4 years ago

Title says it

Other script:

if Player.UserId == game.PrivateServerOwnerId then
    print("true")
else
    print("false")
end

Expected Result: true
Actual Result: false

Reserve Script:

local Code = TeleportService:ReserveServer(4805466213)
                PostKey(Code, SentFrom)
                TeleportService:TeleportToPrivateServer(4805466213, Code, {SentFrom}, "", {string.gsub(Code, "lmG0eAQAAAA2", ""), GetServerSize(SentFrom)})
0
Are there any errors? zomspi 541 — 4y
0
Nope, just it saying false. BradNewTypical 232 — 4y
0
you aren't using the LUA code block correctly, you need to paste your script between the lines zomspi 541 — 4y
0
try the edit I did on my answer zomspi 541 — 4y

2 answers

Log in to vote
0
Answered by
Lakodex 711 Moderation Voter
4 years ago

everyone forgets that a reserved server is technically a VIP server. VIPServerOwnerId is what I use for my WIP game and it works because its apart of a reserved server.

if player.UserId == game.VIPServerOwnerId then
    print("true")
else
    print("false")
end
0
Okay, let me try. I will keep you updated! BradNewTypical 232 — 4y
0
Still returning false BradNewTypical 232 — 4y
0
I fixed it but I'll accept your answer cuz u gave me the idea. BradNewTypical 232 — 4y
Ad
Log in to vote
0
Answered by
zomspi 541 Moderation Voter
4 years ago
Edited 4 years ago

There is nothing wrong with this script, your script to reserve the slot on the other hand is the issue, this script works. If you are trying to reserve the spot by setting the ID as the players user id then the script that does that isn't working.

if Player.UserId == game.PrivateServerOwnerId.Value then 
print("true") 
else 
print("false") end

Try that Please accept this answer if I helped!

0
btw if you need help with that script then post that script zomspi 541 — 4y
0
Wait no I figured it out, you need to put .Value at the end zomspi 541 — 4y
0
My reserve server is fine. Let me make an edit to show you my reserve. BradNewTypical 232 — 4y
0
.Value isn't a property of PrivateServerOwnerId BradNewTypical 232 — 4y
0
You seem to be new to scripting zomspi. Lakodex 711 — 4y

Answer this question