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: attempt to call method 'Clone' (a nil value)

Previous Thread :: Next Thread 
Skiddx10 is not online. Skiddx10
Joined: 05 Jul 2013
Total Posts: 8
29 Dec 2015 08:55 AM
Trying to make a fighting game but i cant clone the map and it says this:

attempt to call method 'Clone' (a nil value)

Help!
Report Abuse
QuintinityZero is not online. QuintinityZero
Joined: 01 Oct 2008
Total Posts: 10618
29 Dec 2015 08:57 AM
Post your code or we can't help you.
Report Abuse
Skiddx10 is not online. Skiddx10
Joined: 05 Jul 2013
Total Posts: 8
31 Dec 2015 12:39 AM
Ok
Report Abuse
Skiddx10 is not online. Skiddx10
Joined: 05 Jul 2013
Total Posts: 8
31 Dec 2015 12:46 AM
local mapsinserverstorage = game:GetService("ServerStorage")
local chosenmap = mapsinserverstorage[math.random(1, #mapsinserverstorage)
chosenmap:Clone().Parent = game.Workspace.mapholder
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
31 Dec 2015 12:48 AM
mapsinserverstorage[math.random(1, #mapsinserverstorage)]*
Report Abuse
mudkip99 is not online. mudkip99
Joined: 17 Jun 2008
Total Posts: 3362
31 Dec 2015 12:50 AM
mapinserverstorage isn't an array, it's the service itself. You'll need to call GetChildren() on it to get an array of it's children, like this:

local serverStorage= game:GetService("ServerStorage")
local maps = serverStorage:GetChildren()
local chosenmap = maps[math.random(1, #maps)
chosenmap:Clone().Parent = game.Workspace.mapholder
Report Abuse
mudkip99 is not online. mudkip99
Joined: 17 Jun 2008
Total Posts: 3362
31 Dec 2015 12:58 AM
Also, like Advanced said, close the square brackets around the array index.
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
31 Dec 2015 01:19 AM
also you may use server storage for other objects than maps, consider putting the maps in side a model in server storage


http://www.roblox.com/ITS-FREE-item?id=130771265&rbxp=8320118
Report Abuse
Skiddx10 is not online. Skiddx10
Joined: 05 Jul 2013
Total Posts: 8
31 Dec 2015 11:20 PM
Thx :-)
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