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: I'm trying to make a custom starterpack in each map

Previous Thread :: Next Thread 
badfitz99 is not online. badfitz99
Joined: 01 May 2010
Total Posts: 5854
25 Apr 2014 11:15 AM
But when I try this script

plrs = game.Players:GetPlayers
weapons = pickedMap.Weapons:GetChildren()

for i = 1, #plrs do
for x = 1, #weapons do
ss = weapons[x]:clone()
ss.Parent = plrs[i].Backpack
end
end

nothing happens. It doesn't break the script, it doesn't give them the weapons and keeps on going.

--The ed edd n eddy fanboy of ot-- Be polite, be professional, but have a plan to kill everybody you meet.
Report Abuse
iOffensive is not online. iOffensive
Joined: 13 Jun 2013
Total Posts: 416
25 Apr 2014 11:20 AM
plrs = game.Players:GetPlayers
weapons = pickedMap.Weapons:GetChildren()

for i = 1, #plrs do
print("Got plrs")
for x = 1, #weapons do
print("Got weapons")
ss = weapons[x]:clone()
print("Cloned weapons")
ss.Parent = plrs[i].Backpack
print("Players have weapons")
end
end


Put this in and run a server. Press F9 and tell me the output
Report Abuse
badfitz99 is not online. badfitz99
Joined: 01 May 2010
Total Posts: 5854
25 Apr 2014 11:26 AM
It seem's that when the first map is loaded, it doesn't clone the weapons. But when it repeats the function and chooses another map, it clones the weapons

--The ed edd n eddy fanboy of ot-- Be polite, be professional, but have a plan to kill everybody you meet.
Report Abuse
iOffensive is not online. iOffensive
Joined: 13 Jun 2013
Total Posts: 416
25 Apr 2014 11:30 AM
plrs = game.Players:GetPlayers
weapons = pickedMap.Weapons:GetChildren()

repeat wait() until Workspace.pickedMap
for i = 1, #plrs do
print("Got plrs")
for x = 1, #weapons do
print("Got weapons")
ss = weapons[x]:clone()
print("Cloned weapons")
ss.Parent = plrs[i].Backpack
print("Players have weapons")
end
end
Report Abuse
badfitz99 is not online. badfitz99
Joined: 01 May 2010
Total Posts: 5854
25 Apr 2014 11:30 AM
I think I have to wait for the backpack to load and then put the weapons in.

--The ed edd n eddy fanboy of ot-- Be polite, be professional, but have a plan to kill everybody you meet.
Report Abuse
iOffensive is not online. iOffensive
Joined: 13 Jun 2013
Total Posts: 416
25 Apr 2014 11:36 AM
So then

character = game.Workspace.Player
plrs = game.Players:GetPlayers
weapons = pickedMap.Weapons:GetChildren()

repeat wait() until plrs:GetPlayerFromCharacter(character)
for i = 1, #plrs do
print("Got plrs")
for x = 1, #weapons do
print("Got weapons")
ss = weapons[x]:clone()
print("Cloned weapons")
ss.Parent = plrs[i].Backpack
print("Players have weapons")
end
end
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
25 Apr 2014 11:51 AM
Just have a map rotation script and make it run another sript(specific for each map) and inside the script access the starterpack game.Workspace.starterpack(or wherever it is) then delete it's contents and then re-add what you want.
Report Abuse
badfitz99 is not online. badfitz99
Joined: 01 May 2010
Total Posts: 5854
25 Apr 2014 11:59 AM
I'm only making the game with one script that controls the map chooser and where the players spawn.

--The ed edd n eddy fanboy of ot-- Be polite, be professional, but have a plan to kill everybody you meet.
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