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: Frustrating Issue

Previous Thread :: Next Thread 
spinywind is online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
27 May 2016 08:37 PM
It just doesnt teleport the player. Anyone know why?



local MapPositions = script["Map Positions"]
local Players = game.Players:GetPlayers()
local MapStats = script["Game Setup"]
local Map = MapStats.Map
local GameMode = MapStats["Game Mode"]
local MapModels = game.Lighting.Maps
local Maps = {
"Castle"
}
local GameModes = {
"Free For All"
}

while true do
-- Choosing Map and Mode --
Map.Value = Maps[math.random(1,#Maps)]
GameMode.Value = GameModes[math.random(1,#GameModes)]
-- Cloning Map --
wait(3)
MapModels[Map.Value]:Clone().Parent = game.Workspace
-- Game Setup --

if Map.Value == Maps[1] then
if GameMode.Value == GameModes[1] then
local Spawns = MapPositions[Map.Value][GameMode.Value]["Spawn 1"]
for i = 1,#Players do
Players[i].Character.Torso.CFrame = CFrame.new(Spawns)
end
end
end

repeat wait() until game.Workspace == nil

end


Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
27 May 2016 08:38 PM
Players[i].Character.Torso.CFrame = CFrame.new(Spawns.Position)?


Report Abuse
doctor152 is online. doctor152
Joined: 30 Nov 2008
Total Posts: 308
27 May 2016 08:39 PM
Players[i].Character.Torso.CFrame = CFrame.new(Spawns.Position)?


Report Abuse
spinywind is online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
27 May 2016 08:39 PM
No. The spawns are vector 3 values.


Report Abuse
Waterlimon is not online. Waterlimon
Joined: 25 Apr 2009
Total Posts: 18821
27 May 2016 08:40 PM
You set the variable 'Players' once at beginning of the script.
So it contains the players who were in game at that point in time.
But if players enter afterwards, they wont be automatically added to the table.
So you have to get the players every time, just before you loop over them. Then it will get all the players.
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
27 May 2016 08:40 PM
My brain cells just perished.

Just use parts m8/8+7


Report Abuse
Waterlimon is not online. Waterlimon
Joined: 25 Apr 2009
Total Posts: 18821
27 May 2016 08:41 PM
Oh and you need to read .Value of the chosen spawn to pass to the CFrame constructor, otherwise youre just passing the Vector3Value object itself?
Report Abuse
spinywind is online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
27 May 2016 08:42 PM
I fixed that but i dont understand what you first stated


Report Abuse
spinywind is online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
29 May 2016 01:56 AM
b


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