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 » Scripters
Home Search
 

Re: Cloning

Previous Thread :: Next Thread 
xXfurheadXx is not online. xXfurheadXx
Joined: 22 Oct 2012
Total Posts: 409
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
BJCarpenter is online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
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
BJCarpenter is online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
18 Mar 2017 12:05 PM
I guess "constant" was a bad word to use there: *Your "ID" variable.
Report Abuse
xXfurheadXx is not online. xXfurheadXx
Joined: 22 Oct 2012
Total Posts: 409
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
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
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
xXfurheadXx is not online. xXfurheadXx
Joined: 22 Oct 2012
Total Posts: 409
18 Mar 2017 12:18 PM
Cool, thanks guys
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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