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

How would I make Quickstart work?

Asked by 4 years ago
Edited 4 years ago

In the game I am currently working on, you can use a feature known as Quickstart. It lets you pick the dungeon, and difficulty, and when you do that, it teleports you instantly.I'm not sure what the best way to do this is, and I'm starting to just give up at this point. I have a script, but it says something about players needing to be an array of players, no idea what that means. If someone can help, please do. Here's my current script (not a localscript).

local TeleportService = game:GetService("TeleportService")
local Place = 4506512824
local RSID = TeleportService:ReserveServer(Place)
local players = game.Players:GetPlayers()
local player = players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
        game:GetService("TeleportService"):TeleportToPrivateServer(Place,RSID,{player})
end)

I dont think this is the right way to go with this, if someone could help, I would appreciate it.If its too much to explain in an answer, dm me on discord at aaw#6447. Thanks!

1 answer

Log in to vote
1
Answered by
exobyteXL 290 Moderation Voter
4 years ago
Edited 4 years ago

Script = a script that runs on the server. LocalScript = a script that runs on the client.

LocalScript:

script.Parent.MouseButton1Click:Connect(function()
script.Parent:WaitForChild("remote"):FireServer()
end)

Script:

local TeleportService = game:GetService("TeleportService")
local Place = 4506512824
local players = game.Players:GetChildren()
local remote = Instance.new("RemoteEvent",script.Parent)
remote.Name = "remote"

remote.OnServerEvent:Connect(function(plr)
local RSID = TeleportService:ReserveServer(Place)
local player = plr
        game:GetService("TeleportService"):TeleportToPrivateServer(Place,RSID,{player})
end)

Parent both scripts to the button.

Previous answer: Link

0
I'll edit it if you ask me to. exobyteXL 290 — 4y
0
Yeah, still not sure. Trisodin529 89 — 4y
0
Just not sure how I'd not use LocalPlayer. I'm confused. About the error and the whole serverscript thing. Trisodin529 89 — 4y
0
Updating post. exobyteXL 290 — 4y
View all comments (11 more)
0
How does it know which player to tp though? Trisodin529 89 — 4y
0
When you fire a RemoteEvent, the first argument it gives back is always the player that fired it. exobyteXL 290 — 4y
0
Other question, can it store multiple players for multiplayer? Trisodin529 89 — 4y
0
Or would I need a bool inside them then have it go through each one and tp individulally or something? Trisodin529 89 — 4y
0
Or would I need a bool inside them then have it go through each one and tp individulally or something? Trisodin529 89 — 4y
0
And yet again, do I have to use Instance.new? Trisodin529 89 — 4y
0
Not individually. Just group them all into one table and then replace {player} with that table. exobyteXL 290 — 4y
0
And yes, if you wanted to make it easy, you could just make a bool. But there's prob another way to make it much easier. exobyteXL 290 — 4y
0
It worked, but, it reverted theplace to what it used to be Trisodin529 89 — 4y
0
We're creating a new server every time. If you wanted to save the dungeon, you'll need to use DataStore. exobyteXL 290 — 4y
0
Nevermind, I just forgot to publish the dungeon, it's all good! Trisodin529 89 — 4y
Ad

Answer this question