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: Whats wrong with this? Help please

Previous Thread :: Next Thread 
kingofthehill1234 is not online. kingofthehill1234
Joined: 15 Mar 2010
Total Posts: 705
22 May 2013 03:40 PM
I have this in a script. It is like road block. Everything works until this point into the script. Its supposed to teleport the Bright blue team to some coordinates, and Bright red to DIFFERENT Coordinates. I won't work. Any help please?

time = 1


while wait(time) do
for i, v in pairs(game.Players:GetPlayers()) do

if gp:GetChildren().TeamColor == ("Bright red") then
v.Character.Torso.CFrame = CFrame.new(130.241, 89.2, 151.575)
elseif gp:GetChildren().TeamColor == ("Bright blue") then
v.Character.Torso.CFrame = CFrame.new(-50.85, 103.2, -21.03)
the ends are later on in the script.

Note: Please note that its not giving me an error in output either. It's like the script isn't getting read, but it stops the rest of the script when it gets to that part.
Report Abuse
kingofthehill1234 is not online. kingofthehill1234
Joined: 15 Mar 2010
Total Posts: 705
22 May 2013 08:39 PM
No help?
Report Abuse
xXStealthsniper200Xx is not online. xXStealthsniper200Xx
Joined: 30 Nov 2011
Total Posts: 2037
22 May 2013 08:51 PM
>No Output
>No Help
Report Abuse
Voidion is not online. Voidion
Joined: 01 Aug 2011
Total Posts: 2668
22 May 2013 09:00 PM
Hold on, what is gp? I don't see any variable named gp.
Report Abuse
sTvcs is not online. sTvcs
Joined: 24 Jun 2012
Total Posts: 704
22 May 2013 09:04 PM
Post the full script.
Report Abuse
kingofthehill1234 is not online. kingofthehill1234
Joined: 15 Mar 2010
Total Posts: 705
23 May 2013 05:46 AM
OH Sorry and I thought I had gp in it... gp = game.Players

I will post the whole script and @First Reply
I said there was NO Error, so No output was shown...
Report Abuse
kingofthehill1234 is not online. kingofthehill1234
Joined: 15 Mar 2010
Total Posts: 705
23 May 2013 05:47 AM
print("Map changing script, and teleportation script loaded!")

print("Map Changing Script Loaded")
while true do
local msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = "Changing map..."
wait(4) -- The text stays on your screen for # seconds (edit)
msg:remove()
wait(1)
game.Lighting.OutGunned:clone().Parent = game.Workspace -- I made this so you don't have to worry about it glitching, as in, staying 1 map for a whole hour.
wait(1)
local msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = ("OutGunned has been picked!")
wait(4) -- The text stays on your screen for # seconds (edit)
msg:remove() -- Removes the message..
time = 10 --Change this to what you edit the map times do be.

while wait(time) do
gp = game.Players
for i, v in pairs(game.Players:GetPlayers()) do

if gp.TeamColor == "Bright red" then
v.Character.Torso.CFrame = CFrame.new(Vector3.new(130.241, 89.2, 151.575))
if gp.TeamColor == "Bright blue" then
v.Character.Torso.Cframe = CFrame.new(Vector3.new(-50.85, 103.2, -21.03))
end
end
end
end
wait(10)-- How long the map is
local msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = "The Game Has ended! A new map will be picked!"
wait(4)
msg:remove()
wait(4)
game.Workspace.OutGunned:remove() -- Removes the map, basicly saying remove feild1 but in scripting it's Map1:remove()
wait(2) --Don't edit this, it might make map2 go on map1
--Copy and Paste above
game.Lighting.Arena:clone().Parent = game.Workspace
wait(20) -- How long you want field2 to be up.
msg.Parent = game.Workspace
msg.Text = "Arena has been picked!"
wait(4) -- The text stays on your screen for # seconds (edit)
msg:remove()
wait(233)
local msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = "The Game Has ended! A new map will be picked!
game.Workspace.Arena:remove()
wait(1) --Repeates, copy the lines to make more maps

end
Report Abuse
TheLagScript is not online. TheLagScript
Joined: 13 Apr 2012
Total Posts: 2004
23 May 2013 06:19 AM
free model

cout << "You Found My Siggy!" << endl;
Report Abuse
kingofthehill1234 is not online. kingofthehill1234
Joined: 15 Mar 2010
Total Posts: 705
23 May 2013 02:16 PM
No its not actually. My friend mad it for me, I didn't like what he had, so I changed the whole script. Go ahead and assume. I didn't erase the messages.
Report Abuse
kingofthehill1234 is not online. kingofthehill1234
Joined: 15 Mar 2010
Total Posts: 705
24 May 2013 06:18 AM
Bump.
Report Abuse
atcop12 is not online. atcop12
Joined: 12 Jun 2011
Total Posts: 236
24 May 2013 10:25 AM
dude he is not kidding I ran his whole script through my studio and I didn't get any out put except that line 51 is a unfished string not even the stuff it supposed to print came out
Report Abuse
TheGamer101 is not online. TheGamer101
Joined: 14 Feb 2009
Total Posts: 11943
24 May 2013 10:36 AM
if gp:GetChildren().TeamColor == ("Bright red") then

There are a few things wrong with this, even presuming gp is properly defined.
GetChildren returns a table. You can't say table.TeamColor. What are you trying to do?
Secondly, TeamColor is not a string value, it is a BrickColor value.

local something =gp:GetChildren()[1] ---unsure of this.
if someting.TeamColor == BrickColor.new("Bright red") then
Report Abuse
TheGamer101 is not online. TheGamer101
Joined: 14 Feb 2009
Total Posts: 11943
24 May 2013 10:37 AM
Wait, scratch what I said about get children in my last post, you fixed that in the script further down.
Report Abuse
kingofthehill1234 is not online. kingofthehill1234
Joined: 15 Mar 2010
Total Posts: 705
24 May 2013 03:26 PM
I'm trying to get two different teams under the colors, "Bright red" And "Bright blue" To teleport to 2 different places at the same time. And choose a random map. Its still not working at all. I do not know why it isn't...
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
24 May 2013 03:38 PM
Did you try what 'TheGamer101' said?

if Bleh.Bleh.TeamColor == BrickColor.new("Bright red") then

etc
Report Abuse
kingofthehill1234 is not online. kingofthehill1234
Joined: 15 Mar 2010
Total Posts: 705
24 May 2013 03:44 PM
It works now, it just teleports me back every 1 second to that spot. if I increase the "Time" to 10, It'll wait 10 to teleport me to the spot, and wait 10 until it keeps Rapidly back to the same spot.
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
24 May 2013 03:46 PM
Remove the loop that surrounds the teleporting of players. It's not needed, or so it looks from where I'm sitting.
Report Abuse
kingofthehill1234 is not online. kingofthehill1234
Joined: 15 Mar 2010
Total Posts: 705
24 May 2013 05:04 PM
Thanks I'll try it. I feel dumb. I forgot the loop xD
Report Abuse
kingofthehill1234 is not online. kingofthehill1234
Joined: 15 Mar 2010
Total Posts: 705
24 May 2013 05:16 PM
Okay, So It started looping the messages and the part of the script that clones the map to workspace. Now I teleport, but it doesn't say the message, "The Game has ended, a New map will be picked" It just leaves me in the map. Heres the script again with the removed loop for the Map picker part,



print("Map changing script, and teleportation script loaded!")

print("Map Changing Script Loaded")

local msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = "Changing map..."
wait(4)
msg:remove()
wait(1)
game.Lighting.OutGunned:clone().Parent = game.Workspace
wait(1)
local msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = ("OutGunned has been picked!")
wait(4)
msg:remove()
local msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = "Teleporting Players..."
wait(3)
msg:remove()

time(10)



wait(time)
for i, v in pairs(game.Players:GetPlayers()) do

local gp = game.Players:GetChildren()[1]
if gp.TeamColor == BrickColor.new("Bright red") then
v.Character.Torso.CFrame = CFrame.new(Vector3.new(130.241, 89.2, 151.575))
if gp.TeamColor == BrickColor.new("Bright blue") then
v.Character.Torso.CFrame = CFrame.new(Vector3.new(-50.85, 103.2, -21.03))

print("The Teleportation Works!")



wait(2)
local msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = "The Game Has ended! A new map will be picked!"
wait(4)
msg:remove()
wait(4)
game.Workspace.OutGunned:remove()
wait(2)
--Copy and Paste above
game.Lighting.Arena:clone().Parent = game.Workspace
wait(20)
msg.Parent = game.Workspace
msg.Text = "Arena has been picked!"
wait(4)
msg:remove()
wait(233)
local msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = "The Game Has ended! A new map will be picked!"
game.Workspace.Arena:remove()
end
end
end
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
24 May 2013 05:21 PM
Add three ends after the last if statement checking the player's team colour. You don't need the last three on your script after that. You'll need to loop the whole script to start new rounds, etc I just meant to remove the one that started before getting all the players, and after.
Report Abuse
kingofthehill1234 is not online. kingofthehill1234
Joined: 15 Mar 2010
Total Posts: 705
24 May 2013 07:08 PM
Thanks a lot. It now works. I just have to make more maps. Before I do, can I add while true do at the very top again? Or no? Just so I just add one map at a time to the script, And not make a huge pattern of the same maps,
Outgunned
HighTops
ScrapYard
Outgunned
HighTops
ScrapYard

etc. That's what I don't want to have to do.
Report Abuse
kingofthehill1234 is not online. kingofthehill1234
Joined: 15 Mar 2010
Total Posts: 705
26 May 2013 01:55 PM
Okay, now I teleport, but I stay in the map forever now. Help?
Report Abuse
kingofthehill1234 is not online. kingofthehill1234
Joined: 15 Mar 2010
Total Posts: 705
26 May 2013 02:55 PM
AND, you can only make it work by testing it from studio into Play Solo. When I play it its like that script didn't exist.
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