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: How To Set Spawn Without Spawn Location

Previous Thread :: Next Thread 
CyberneticCore is not online. CyberneticCore
Joined: 13 Jul 2016
Total Posts: 140
28 Aug 2016 08:22 PM
I want to set a player's spawn point without using a Spawn Location. It's for an obby. I know you can do this with CFrame but I can't get it to work.
Report Abuse
Flashiness is not online. Flashiness
Joined: 25 Dec 2012
Total Posts: 1212
28 Aug 2016 08:25 PM
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
[insert conditional here]
character.HumanoidRootPart.Position = [Partname].Position
end
end)
end)

I think something like that would work but dont quote me on it


+1
Report Abuse
Baseness is not online. Baseness
Joined: 07 Oct 2015
Total Posts: 1001
28 Aug 2016 08:25 PM
Player.CharacterAdded and CFrame to a position


Report Abuse
CyberneticCore is not online. CyberneticCore
Joined: 13 Jul 2016
Total Posts: 140
28 Aug 2016 08:27 PM
Nope, still doesn't work. That's pretty much the exact same thing I already did, except that I used Torso instead.
Report Abuse
laczka is not online. laczka
Joined: 26 Jan 2015
Total Posts: 258
28 Aug 2016 08:29 PM
Assuming that your main spawn is name spawnPart, the script would probably look a bit like this:
local spawnPart = game:GetService("Workspace").spawnPart
game:GetService("Players").PlayerAdded:connect(function(plr)
local gamePlr = game:GetService("Workspace"):FindFirstChild(plr.Name)
gamePlr:FindFirstChild("Torso").CFrame = CFrame.new(spawnPart.CFrame)
gamePlr:FindFirstChild("Humanoid").Died:connect(function()
repeat
wait()
until gamePlr:FindFirstChild("Humanoid").Health ~= 0
gamePlr.CFrame = CFrame.new(spawnPart.CFrame)
end) end)
Report Abuse
Flashiness is not online. Flashiness
Joined: 25 Dec 2012
Total Posts: 1212
28 Aug 2016 08:30 PM
output errors?

try putting print functions within the functions to see if they're running or not

game.Players.PlayerAdded:connect(function(player)
print('PlayerAdded')
player.CharacterAdded:connect(function(character)
print('CharacterAdded')
[conditional]
print('Conditional is true')
character.HumanoidRootPart.Position = [Part].Position
end
end)
end)

something like that to see if they're running properly. could be an issue with the conditional because its not true or something.


+1
Report Abuse
CyberneticCore is not online. CyberneticCore
Joined: 13 Jul 2016
Total Posts: 140
28 Aug 2016 08:33 PM
@Flashiness I have done that already, it seems everything except the actual teleporting itself works. I don't see why the CFrame doesn't work though, since I tested it outside of the conditional.
Report Abuse
CyberneticCore is not online. CyberneticCore
Joined: 13 Jul 2016
Total Posts: 140
28 Aug 2016 08:34 PM
btw I used CFrame not Position.
Report Abuse
laczka is not online. laczka
Joined: 26 Jan 2015
Total Posts: 258
28 Aug 2016 08:34 PM
@flashiness, or if he wants the game filtering enabled, he could :FireServer with a remoteEvent in a local script whenever a client joins, then from there take in input as a variable to the OnServerEvent function in a server script, and from there compare the input taken in without even needing to print unnecessarily.
Report Abuse
Flashiness is not online. Flashiness
Joined: 25 Dec 2012
Total Posts: 1212
28 Aug 2016 08:34 PM
Not sure then, You could try another method like :Lerp() or something but it should work. I really don't know why it isnt working then


+1
Report Abuse
CyberneticCore is not online. CyberneticCore
Joined: 13 Jul 2016
Total Posts: 140
28 Aug 2016 08:36 PM
I've been staring at this line alone for 1 and a half hours... this shouldn't be that hard lol.
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
28 Aug 2016 08:44 PM
just add a Vector3Value/CFrameValue inside player or something and on CharacterAdded teleport them there :/

Formerly ToxicDominator - add 17,509 posts
Report Abuse
llaserx is not online. llaserx
Joined: 10 Dec 2011
Total Posts: 53069
28 Aug 2016 08:57 PM
Character:moveto()
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