generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Teleporting a person back to a random spawn point

Previous Thread :: Next Thread 
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
09 Jul 2015 11:34 PM
Well, I can't use :LoadCharacter() because the LoadingGui is gonna go away, so I have to use either CFrame or Vector3, heres the script (No idea if math.random was a solution here):

local loadingGuiClone = game.StarterGui.LoadingGui:Clone()
loadingGuiClone.Parent = script.Parent
for i = 1, 0, -0.1 do
wait()
loadingGuiClone.Frame.BackgroundTransparency = i
loadingGuiClone.Frame.TextLabel.BackgroundTransparency = i
loadingGuiClone.Frame.TextLabel.TextTransparency = i
end
wait(5)
local spawns = game.Workspace.Lobby.Spawn.SpawnPoints:GetChildren()
local randomspawn = math.random(1,#spawns)
script.Parent.Parent.Character:MoveTo(randomspawn)
for i = 0, 1, 0.1 do
wait()
loadingGuiClone.Frame.BackgroundTransparency = i
loadingGuiClone.Frame.TextLabel.BackgroundTransparency = i
loadingGuiClone.Frame.TextLabel.TextTransparency = i
end
wait(1)
loadingGuiClone:Destroy()



Mixtape Coming Out 2020!
Report Abuse
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
09 Jul 2015 11:36 PM
Oh yea, also, this is a local script and right at this phase, it's in the player's playergui



Mixtape Coming Out 2020!
Report Abuse
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
10 Jul 2015 12:00 AM
Bumpity Bump Bump



Mixtape Coming Out 2020!
Report Abuse
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
10 Jul 2015 12:34 AM
Bumpity bump bump of sadness D:



Mixtape Coming Out 2020!
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
10 Jul 2015 12:41 AM
moveto is deprecated change the CFrame of the torso instead
Report Abuse
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
10 Jul 2015 12:45 AM
so, "script.Parent.Parent.Character.Torso.CFrame = CFrame.new(randomspawn)"?



Mixtape Coming Out 2020!
Report Abuse
FactualTheory is not online. FactualTheory
Joined: 10 Sep 2013
Total Posts: 1365
10 Jul 2015 12:45 AM
pretty much.
Report Abuse
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
10 Jul 2015 01:02 AM


I tried that and this error came up: "bad argument #1 to 'new' (Vector3 expected, got number)"

I used the exact same line of code from the last comment

Mixtape Coming Out 2020!
Report Abuse
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
10 Jul 2015 01:19 AM
bumpity bump bump of hope? :D



Mixtape Coming Out 2020!
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
10 Jul 2015 01:22 AM
moveto is not depericated
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
10 Jul 2015 01:29 AM
MoveTo(randomspawn.Position)
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
10 Jul 2015 01:34 AM
also, just because something is deprecated doesn't mean it's disfunctional
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
10 Jul 2015 10:23 AM
right but it means that you shouldnt use it because there's a reason its deprecated.
Report Abuse
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
10 Jul 2015 11:12 PM
What's the reason?
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
11 Jul 2015 03:29 AM
usually they make a new(and sometimes better) method but MoveTo() isn't deprecated so you're fine

some deprecated methods include:

:service() - now :GetService()
:children() - now :GetChildren()
:playerFromCharacter - now :GetPlayerFromCharacter()
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
11 Jul 2015 03:32 AM
a better example would be how they replaced data persistence (http://wiki.roblox.com/index.php?title=Data_persistence) with data stores (http://wiki.roblox.com/index.php?title=Data_store)
Report Abuse
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
11 Jul 2015 12:42 PM
When I do script.Parent.Parent.Character:MoveTo(randomspawn.Position), it keeps telling me Move to is not a valid member of Part



Mixtape Coming Out 2020!
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
11 Jul 2015 01:04 PM
. . .Character is a Player's Character, not a part name Character inside the player, right?. . .
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
11 Jul 2015 01:05 PM
unless you made a part named Character inside of them I don't really see why you would get that error
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image