Jump to content

Recommended Posts

21 minutes ago, Parusoid said:

what if there are more than one of the same character

local g = c_spawn("item", count); AllPlayers[playernumber].components.inventory:GiveItem(g) the player number thing is the order in which some joins. 1 first 2 second and so on.

function c_run(prefab, radius, period, count) 

radius = radius or 12;

period = period or 0.2 

count = count or 1

  local x,y,z = ThePlayer.Transform:GetWorldPosition()

  local targets = TheSim:FindEntities(x,y,z, radius, nil,  {"CLASSIFIED", "player", "FX", "playerghost", "wall", "structure"} )

  for _,t in pairs(targets) do t:DoPeriodicTask(period, function(inst) local x,y,z = inst.Transform:GetWorldPosition(); local s = c_spawn(prefab); if s == nil then return nil end; s.Transform:SetPosition(x,y,z) end) end end 

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...