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 » Scripting Helpers
Home Search
 

Help Please.

Previous Thread :: Next Thread 
kingbowler1040 is not online. kingbowler1040
Joined: 03 Oct 2011
Total Posts: 1202
08 Dec 2013 11:58 AM
wait(3)
local player = game.Players:GetPlayers()
for i = 1, #player do
player[i].Character.Torso.CFrame = CFrame.new(20, 111, 20)
end
script:Destroy()

This only works in studio test mode.

I thought maybe it doesn't work cause it waits 3 seconds while the game doesn't have any players, so.... If that is the case:

if game.Players.NumPlayers < 1 then
wait(3)
local player = game.Players:GetPlayers()
for i = 1, #player do
player[i].Character.Torso.CFrame = CFrame.new(20, 111, 20)
end
end
script:Destroy()

Help??
Report Abuse
kingbowler1040 is not online. kingbowler1040
Joined: 03 Oct 2011
Total Posts: 1202
08 Dec 2013 12:02 PM
Neither codes work.

Needed a additional end, aswell.
Report Abuse
GGwashere123 is not online. GGwashere123
Joined: 10 Jun 2012
Total Posts: 440
08 Dec 2013 12:43 PM
If NumPlayers < 1 then either the player hasn't been added yet or there are no players so no point in putting a CoordinateFrame on a player's Torso that doesn't exist yet.

Use the CharacterAdded event.
Report Abuse
kingbowler1040 is not online. kingbowler1040
Joined: 03 Oct 2011
Total Posts: 1202
08 Dec 2013 01:19 PM
IF there is one or more players in the game, it teleports -_-
Report Abuse
GGwashere123 is not online. GGwashere123
Joined: 10 Jun 2012
Total Posts: 440
08 Dec 2013 01:20 PM
then do if game.Players.NumPlayers > 1 then
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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