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: finding a variable in workspace

Previous Thread :: Next Thread 
CodeBot is not online. CodeBot
Joined: 01 Jul 2011
Total Posts: 439
15 Apr 2014 09:20 PM
alright im trying to find the childadded in workspace and im trying to go edit his LeftLeg to be transparent.

game.Players.PlayerAdded:connect(function(player)

print(player.Name)
name = player.Name
game.Workspace.name.LeftLeg.Transparency = 1 --ERROR name is

end)

Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
15 Apr 2014 09:22 PM
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
char["Left Leg"].Transparency = 1
end)end)

--Your script had nothing to do with a childadded event. Learn your termonlogy.
Report Abuse
CodeBot is not online. CodeBot
Joined: 01 Jul 2011
Total Posts: 439
15 Apr 2014 09:23 PM
soo many views, yet no replys
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
15 Apr 2014 09:25 PM
^Gee thanks.
Report Abuse
CodeBot is not online. CodeBot
Joined: 01 Jul 2011
Total Posts: 439
18 Apr 2014 02:25 PM
^ i said that while you were typing it.
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
18 Apr 2014 03:04 PM
game.Players.PlayerAdded:connect(function(player)

print(player.Name)
name = player.Name
Workspace:FindFirstChild(name)["Left Leg"].Transparency = 1

end)
Report Abuse
powertool is not online. powertool
Joined: 01 Feb 2008
Total Posts: 3771
18 Apr 2014 03:06 PM
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(chr)
chr['Left leg'].Transparency = 1
end) end)

That said, a character isn't a variable, a boolvalue is. If you're looking for something that might not be there, or a value that's a child of another instance, do this.

value = path.to.instance:FindFirstChild("ValueName")
blah = 0x42 .. 0x6C .. 0x61 .. 0x68 --Guess what this says?

Then to change it,

value.Value = blah

--Shira
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