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: Team color problems

Previous Thread :: Next Thread 
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
19 Oct 2013 11:27 AM
whats' 'sposed to happen is when you click a button you spawn, according to what team you're on.


the output says
12:25:21.179 - Players.Player1.PlayerGui.Spawn_Menu.Gui_Holder.Enter_Map_B:12: bad argument #2 to '?' (string expected, got userdata)
12:25:21.180 - Script 'Players.Player1.PlayerGui.Spawn_Menu.Gui_Holder.Enter_Map_B', Line 12

the script:

local player = game.Players.LocalPlayer
local character = player.Character
local map = game.Players.LocalPlayer.PlayerGui.Spawn_Menu.Gui_Holder.Current_Map
local target = Workspace[map.Value]

script.Parent.MouseButton1Click:connect(function()
print "clicked"
script.Parent.Parent.Player_Spawned.Value = true
game.Players.LocalPlayer.CameraMode = "LockFirstPerson"
print "test"
if player.TeamColor == BrickColor.new("Really red")
then player.Character:MoveTo(Workspace[target].Team_1_Spawn.Position)
print "test2"

elseif player.TeamColor == BrickColor.new("Really blue")
then player.Character:MoveTo(Workspace[target].Team_2_Spawn.Position)
print "test3"

end
end)



When life gives you lemons, Squirt 'em in your eyes. - Drahsid5
Report Abuse
Cav33 is not online. Cav33
Joined: 04 Sep 2012
Total Posts: 1375
19 Oct 2013 11:49 AM
I see the problem...or um problems to be exact:

local player = game.Players.LocalPlayer
local character = player.Character
local map = game.Players.LocalPlayer.PlayerGui.Spawn_Menu.Gui_Holder.Current_Map

local target = Workspace[map.Value] <<========================== This line has a problem!

script.Parent.MouseButton1Click:connect(function()
print "clicked"
script.Parent.Parent.Player_Spawned.Value = true
game.Players.LocalPlayer.CameraMode = "LockFirstPerson"
print "test"
if player.TeamColor == BrickColor.new("Really red")
then player.Character:MoveTo(Workspace[target].Team_1_Spawn.Position)
print "test2"

elseif player.TeamColor == BrickColor.new("Really blue")
then player.Character:MoveTo(Workspace[target].Team_2_Spawn.Position)
print "test3"

end
end)



Change it to:

local target = map.Value
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
19 Oct 2013 02:54 PM
thanks c:

When life gives you lemons, Squirt 'em in your eyes. - Drahsid5
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