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: ObjectValues

Previous Thread :: Next Thread 
tidus019 is not online. tidus019
Joined: 12 Nov 2008
Total Posts: 132
19 May 2013 07:46 AM
Hello, I have a (relatively) simple question: How do you use an ObjectValue, and in which scenarios would it be good to use one?

The wiki didn't realy explain it to me.
"An ObjectValue is a very simple value; it holds an object reference as it's value."

Thanks
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
19 May 2013 07:52 AM
i wouldn't use it. its just a more complicated way that's just simply unnecessary.
Report Abuse
TheGamer101 is not online. TheGamer101
Joined: 14 Feb 2009
Total Posts: 11943
19 May 2013 08:18 AM
A good example of the use of object values is the tagging KOs by weapons. When a player dies, roblox checks for an ObjectValue called "creator" inside that players humanoid. If that object value exists, roblox awards the player that object value references a KO.

For example the value of the creator ObjectValue could be :
game.Players.TheGamer101
Report Abuse
chaokid9 is not online. chaokid9
Joined: 29 Aug 2008
Total Posts: 6187
19 May 2013 08:26 AM
It is pretty useful, like TheGamer101 said, to store player names. If you want a tycoon block only collectible by the owner you would do something like:
function OnTouch(Toucher)
if Toucher.Parent == ObjectValue.Value
then
harvest()
else
print("You do not own this block!")
end
end

I didn't test that so the syntax is probably off, but you get the point.
Report Abuse
tidus019 is not online. tidus019
Joined: 12 Nov 2008
Total Posts: 132
20 May 2013 04:24 AM
Ah! That's useful indeed. This way you can make things only useable by one player in a very neat way. Thanks!
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