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: Help

Previous Thread :: Next Thread 
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
10 Apr 2015 09:05 PM
local spawns = curmap:FindFirstChild("Spawns"):GetChildren()
local randomspawn = math.random(1, #spawns)
local newzombie = zombie:Clone()
zombie.Parent = workspace
zombie:MakeJoints()
zombie:MoveTo(spawns[randomspawn.Position])






21:04:11.750 - ServerScriptService.SpawnZombie:29: attempt to index local 'randomspawn' (a number value)



How do I fix this?



Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
10 Apr 2015 09:12 PM
local randomspawn = spawns[math.random(1, #spawns)]
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
10 Apr 2015 09:12 PM
b
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
10 Apr 2015 09:12 PM
zombie:MoveTo(randomspawn.Position)
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
10 Apr 2015 09:14 PM
Ok another question

function spawnfunc()
for i = 60, 0, -5 do
wait(5)
local spawns = curmap:FindFirstChild("Spawns"):GetChildren()
local randomspawn = math.random(1, #spawns)
local newzombie = zombie:Clone()
zombie.Parent = workspace
zombie:MakeJoints()
zombie:MoveTo(spawns[randomspawn].Position)
end
end


This is moving the current zombie BACK to its position, and not making another one
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
10 Apr 2015 09:18 PM
function spawnfunc()
for i = 60, 0, -5 do
wait(5)
local spawns = curmap:FindFirstChild("Spawns"):GetChildren()
local randomspawn = spawns[math.random(1, #spawns)]
local newzombie = zombie:Clone()
zombie.Parent = workspace
zombie:MakeJoints()
zombie:MoveTo(randomspawn.Position)
end
end
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
10 Apr 2015 09:19 PM
There isn't a different between that and mine..?
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
10 Apr 2015 09:23 PM
b

function spawnfunc()
for i = 60, 0, -5 do
wait(5)
local spawns = curmap:FindFirstChild("Spawns"):GetChildren()
local randomspawn = math.random(1, #spawns)
local newzombie = zombie:Clone()
zombie.Parent = workspace
zombie:MakeJoints()
zombie:MoveTo(spawns[randomspawn].Position)
end
end
Report Abuse
SummerEquinox is online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
10 Apr 2015 09:24 PM
Actually there was a huge difference, look at it carefully.
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
10 Apr 2015 09:26 PM
His still won't create a new one. So....
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
10 Apr 2015 09:32 PM
b2
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
10 Apr 2015 09:37 PM
b3
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
10 Apr 2015 09:39 PM
There was two differences. Are you calling the function lol?
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
10 Apr 2015 09:39 PM
local status = game.ServerScriptService.Main.Value
local zombie = game.ServerStorage.Zombie
local event = game.ReplicatedStorage.SpawnSequence


event.Event:connect(function(...)
local tuple = (...)
if tuple == ("Spawn") then
local map = game.Workspace.CurrentMap
for _, v in pairs(map:GetChildren()) do
curmap = v
end

function timerfunc()
for i = 60, 0, -1 do
wait(1)
status.Value = i
end
end

function spawnfunc()
for i = 60, 0, -5 do
wait(5)
local spawns = curmap:FindFirstChild("Spawns"):GetChildren()
local randomspawn = spawns[math.random(1, #spawns)]
local newzombie = zombie:Clone()
zombie.Parent = workspace
zombie:MakeJoints()
zombie:MoveTo(randomspawn.Position)
end
end

local timercor = coroutine.create(timerfunc)
local spawncor = coroutine.create(spawnfunc)









for i = 10, 0, -1 do
wait(1)
status.Value = i.." seconds until Wave 1"
end

coroutine.resume(timercor)
coroutine.resume(spawncor)


repeat wait() until coroutine.status(timercor) == "dead" and coroutine.status(spawncor) == "dead"

for i = 10, 0, -1 do
wait(1)
status.Value = i.." seconds until Wave 2"
end

coroutine.resume(timercor)
coroutine.resume(spawncor)

repeat wait() until coroutine.status(timercor) == "dead" and coroutine.status(spawncor) == "dead"
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
10 Apr 2015 09:49 PM
bbbbbbbbbb
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
11 Apr 2015 11:43 AM
b again. why is this not working..?!
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
11 Apr 2015 11:52 AM
bb
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