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: Random spawns

Previous Thread :: Next Thread 
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
17 Jun 2016 12:46 AM
the weapons go to the same pad everytime
can I get some help

https://gyazo.com/6c48eab34e7447e17ca36e07f7d5db3e


script:


newspawn = workspace["new spawn"]
weapons = game.ServerStorage:GetChildren()
spawns = workspace.WeaponSpawns:GetChildren()




newspawn.Changed:connect(function()
wait(2)

for i,v in pairs(game.ServerStorage:GetChildren()) do
v:Clone()
print("Cloned")
v.Parent = workspace
print("parented")
for p,b in pairs(v:GetChildren()) do
if b:IsA("Part") then
b.CFrame = CFrame.new(spawns[i].Position)
end
end
end
end)





Report Abuse
ChocoIateOverdose is not online. ChocoIateOverdose
Joined: 02 Jun 2012
Total Posts: 2454
17 Jun 2016 12:47 AM
i dont see any attempt at making it random
Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
17 Jun 2016 12:49 AM
how would you do so^


Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
17 Jun 2016 12:54 AM
b1


Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
17 Jun 2016 12:58 AM
b2


Report Abuse
ChocoIateOverdose is not online. ChocoIateOverdose
Joined: 02 Jun 2012
Total Posts: 2454
17 Jun 2016 01:01 AM
lazy and just woke up so this is sort of pseudo code combined with lazy code

c=weapons:children
for i=1,#c do
spawn=spawns:children[math.random(1,#spawns:children()) ]
spawn. parent=workspace
c[i].Cframe=spawn. parent
end
Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
17 Jun 2016 01:10 AM
I dont know how to add that to my code



Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
17 Jun 2016 01:18 AM
b3


Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
17 Jun 2016 01:30 AM
newspawn = workspace["new spawn"]
weapons = game.ServerStorage:GetChildren()
spawns = workspace.WeaponSpawns:GetChildren()




newspawn.Changed:connect(function()
local fakeTable = spawns
for i,Tool in pairs(game.ServerStorage:GetChildren()) do
local v = math.random(1,#fakeTable)
local spawn = fakeTable[val]
local newTool = Tool:Clone()
newTool.Parent = game.Workspace
newTool.Handle.CFrame = spawn.CFrame
table.remove(fakeTable,val)
end
end)


the power of the meme ( ͡° ͜ʖ ͡°)
Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
17 Jun 2016 01:30 AM
b4


Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
17 Jun 2016 02:09 AM
b5


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