|
| 21 Jul 2011 10:08 AM |
im making a tycoon and i need to save the player as an object. then whenever somebody presses the button,i need to make the script check if the player is the same one as the one saved.
Anyone know how to do that?
|
|
|
| Report Abuse |
|
|
Ozzypig
|
  |
| Joined: 27 Mar 2008 |
| Total Posts: 4906 |
|
|
| 21 Jul 2011 10:11 AM |
Instead of saving the player, save the name.
Make a StringValue object and save the owner's name to the StringValue's Value property. If nobody owns it, set the StringValue's value to a blank string ("").
Check for a blank string when they want to claim it, and if they can, set their name.
No need to use complicated ObjectValues!
~Ozzy |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2011 10:18 AM |
| thx...now how do i make a StringValue? |
|
|
| Report Abuse |
|
|
Ozzypig
|
  |
| Joined: 27 Mar 2008 |
| Total Posts: 4906 |
|
|
| 21 Jul 2011 10:19 AM |
In Studio, Insert > Object > StringValue
Or via script: Instance.new("StringValue", workspace) |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Jul 2011 10:36 AM |
| ok, im in roblox studio and clicked string value. Under Players there is the "Value". I made the value (""). Now how do i save the owner to the stringvalue? |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2011 10:49 AM |
| nvm,i think i got it,i draged the "OwnerName" thingys to the "Value". I set the value for the string value to (""). I left the values blank for the OwnerName thingys. Is that right? |
|
|
| Report Abuse |
|
|