#zombie spawner
1 messages · Page 1 of 1 (latest)
Wouldnt you make a rng for the pos of zombies ?
you can use math.random to get the X and Z axis
and also you can do :Clone on the zombie model that you have
or he can place a lot of spawn points and just choose random
kidna stinky method tho
i dont really like that
its good for beginners
you can use raycast down from sky
local function findRandomSpawnPoint()
local mapSize = 500 --map size in here
local randomX = math.random(-mapSize/2, mapSize/2)
local randomZ = math.random(-mapSize/2, mapSize/2)
local skyPosition = Vector3.new(randomX, 200, randomZ) --how far it start
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
raycastParams.FilterDescendantsInstances = {} -- add here things to ignore
local rayResult = workspace:Raycast(skyPosition, Vector3.new(0, -300, 0), raycastParams)
if rayResult then
return rayResult.Position + Vector3.new(0, 5, 0)
end
return nil
end
also as cash said you can create invisable parts around you map as spawn points which is the only positive thing about it thats it more controlled
you can also do spawn regions , for example
local spawnRegions = {
{min = Vector3.new(-100, 0, -100), max = Vector3.new(100, 0, 100)}, -- center
{min = Vector3.new(200, 0, -50), max = Vector3.new(300, 0, 50)} -- side
}
and how can i do that? im new to scripting lol
oh ok
thanks!
this is actually a fire method, ive never thought of that
figure it out :D
wait lemme try
thats the fun of scripting
server script service
oh ok
i dont know what to type in map size, i have four walls, with the size 400, so that means i need to type 400 in mapSize?? ||@urban ridge||
how wide is your map?
** You are now Level 2! **
nah i trust you