|
| 18 Mar 2017 12:00 PM |
| How should I go about cloning something into workspace but making it so one player controls that object without using tools? Do I give it a random ID if not already used then give that ID to the player? |
|
|
| Report Abuse |
|
|
|
| 18 Mar 2017 12:04 PM |
For unique Names, if just increment some constant by one every time I clone something then add the constant to the name of the object. You will never reach some maximum number..... in your lifetime, anyway.
Random could produce the same name at some point. |
|
|
| Report Abuse |
|
|
|
| 18 Mar 2017 12:05 PM |
| I guess "constant" was a bad word to use there: *Your "ID" variable. |
|
|
| Report Abuse |
|
|
|
| 18 Mar 2017 12:10 PM |
| Alright thanks, another question though: would it be more effective to make the name of object the name + player's name? Would that be easier or harder to impliment |
|
|
| Report Abuse |
|
|
|
| 18 Mar 2017 12:12 PM |
Instead of making a variable ID, I prefer to use the PlayerID.
object.Name = "objectName" + player.UserId
That will guarantee you have a unique name for each player, and you can easily reference the player's model with
workspace["objectName" + player.UserId]
:)
-The [Guy] |
|
|
| Report Abuse |
|
|
| |
|