I want to achieve a button I’ve been working on when pressed, reserves a server for the player and teleports them to it.
When I get teleported, I’m being teleported to the same place I started with. (This is a secondary place, not the spawn place inside of the universe/game, teleporting to another non-spawn place)
I have tried looking at other scripts on teleport reserves, and it’s not working. I’m a little stuck now.
Client Script:
ContinueSolo.MouseButton1Click:Connect(function()
click:Play()
modOr.Modal = false
uis.MouseIconEnabled = false
frame:TweenSize(UDim2.new(1.008, 0,0.016, 0),"Out","Quart",.3,true)
wait(.3)
frame.Visible = false
TPFrame.tpText:TweenSize(UDim2.new(0, 287,0, 99),"InOut","Quint",.5,true)
wait(.5)
game.ReplicatedStorage.soloTp:FireServer() -- fires to server for reserve TP
end)
Server Script (runs when client activates)
game.ReplicatedStorage.soloTp.OnServerEvent:Connect(function(player)
local placeSolo = game:GetService("TeleportService"):ReserveServer(12309491813) --is the place id supposed to be the id of the place the player gets teleported to?
game:GetService("TeleportService"):TeleportToPrivateServer(12309491813, placeSolo, { player })
end)
I’ve really been trying to look for solutions and researching teleport service, but it’s not working.
Anything helps.
Thanks, cal