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: sorta stuck here

Previous Thread :: Next Thread 
Laedere is online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
11 Jan 2014 05:34 PM
script.Parent.ClickDetector.MouseClick:connect(function(capture)
name = capture.Name
teamname = capture.TeamColor
for i, v in pairs(game.Teams:GetChildren()) do
if v.TeamColor == teamname then
game.Workspace.owner.Value =
end
end
end)

I'm trying to get a string value in the workspace with the name owner, I'm stuck on trying to figure out what to put on game.Workspace.owner.Value

I want it to be the color of the team from the person who clicked the part
Report Abuse
Laedere is online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
11 Jan 2014 05:37 PM
whoops, I want it to be the name of the team of the person who clicked it, not the color
Report Abuse
Laedere is online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
11 Jan 2014 05:42 PM
.
Report Abuse
Laedere is online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
11 Jan 2014 05:44 PM
..
Report Abuse
Drizzlecutt is not online. Drizzlecutt
Joined: 23 Oct 2013
Total Posts: 136
11 Jan 2014 05:44 PM
Try this:

game.Workspace.owner.Value = tostring(capture.TeamColor)
Report Abuse
Laedere is online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
11 Jan 2014 05:45 PM
I want the name of the team not the color
Report Abuse
Drizzlecutt is not online. Drizzlecutt
Joined: 23 Oct 2013
Total Posts: 136
11 Jan 2014 05:48 PM
what I would do is to create a function for that, but there may be another way

local function getTeamName(color)
for _,v in pairs(game.Teams:GetChildren()) do

if v.TeamColor == color then
return v.Name
end

return nil
end

game.Workspace.owner.Value = getTeamName(capture.TeamColor)
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