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
 

Re: Moving Characters

Previous Thread :: Next Thread 
Azureous is not online. Azureous
Joined: 29 Jan 2012
Total Posts: 25287
05 Jun 2014 05:57 PM
--Before I start, I've had hell with this script… for some reason in God's name this won't work… after weeks of trying :L

--Problems: I have all of these bricks placed in the workspace, 1 table if for in the map, the other table is for the lobby. If a player spawns with the "IsPlaying" BoolValue equalling true then they should be moved into a random brick on the map, but if the "IsPlaying" BoolValue is false then they are moved to a random place on the lobby.

--Here's the code:


local MapSpawns = {Workspace.a.CFrame,Workspace.c.CFrame,Workspace.d.CFrame,Workspace.e.CFrame,Workspace.f.CFrame,Workspace.g.CFrame,Workspace.h.CFrame,Workspace.i.CFrame}

local LobbySpawns = {Workspace.Sp1.CFrame,Workspace.Sp2.CFrame,Workspace.Sp3.CFrame,Workspace.Sp4.CFrame, Workspace.Sp5.CFrame,Workspace.Sp6.CFrame,Workspace.Sp7.CFrame,Workspace.Sp8.CFrame,Workspace.Sp9.CFrame,Workspace.Sp10.CFrame}

local function SpawnCorrectly(Player)
print(1)
Player:WaitForChild("IsPlaying")
print(2)
Player.CharacterAdded:connect(function(char)
if Player.IsPlaying.Value == true then
print(3)
char:WaitForChild("Torso").CFrame = MapSpawns[math.random(1,#MapSpawns)]
print(4)
elseif Player.IsPlaying.Value == false then
print(3.1)
char:WaitForChild("Torso").CFrame = LobbySpawns[math.random(1,#LobbySpawns)]
print(4.1)
end
end)
end

game.Players.PlayerAdded:connect(SpawnCorrectly)
for Index, Player in pairs(game.Players:GetPlayers()) do
SpawnCorrectly(Player)
end

--The prints throughout the code all appear in the output, HOWEVER the player is never moved to the designated bricks…

--Someone please help~!
Report Abuse
Azureous is not online. Azureous
Joined: 29 Jan 2012
Total Posts: 25287
05 Jun 2014 05:59 PM
Really need help here… this should work but it does not…
Report Abuse
Azureous is not online. Azureous
Joined: 29 Jan 2012
Total Posts: 25287
05 Jun 2014 06:03 PM
-Sigh
Report Abuse
WickedSiege is not online. WickedSiege
Joined: 03 Oct 2011
Total Posts: 3039
05 Jun 2014 06:07 PM
Don't disgrace god's name just cause your script won't work.
Report Abuse
Azureous is not online. Azureous
Joined: 29 Jan 2012
Total Posts: 25287
05 Jun 2014 06:12 PM
.-.
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