Returns entities contained in the radius around the center position.
spawnKitEntity(kitType: , position:): | nil
Spawns an entity using a BedWars model at the specified position. Use the returned object to further configure the .
Example usage:
Events.MatchStart(function(event)
-- Add a Barbarian Kit entity to the game when the match begins
local kit = EntityService.spawnKitEntity(KitType.BARBARIAN, BlockService.getAboveRandomBlock())
-- Give the kit entity a rageblade weapon
kit:setHandItem(ItemType.RAGEBLADE)
-- Gives the kit a set of Iron armor
kit:setArmor(ItemType.IRON_HELMET)
end)
Spawns a using a BedWars model at the specified position. Use the optional team parameter with Skeletons or Ducks to set them to be allied with that . Use the returned object to further configure the entity.
Example usage:
Events.EntityDeath(function(event)
-- Only spawn a creature if the entity that died was a player
if (event.entity:getPlayer() == nil) then
return
end
-- Only spawn a creature if this was the final kill of the player
if not event.finalKill then
return
end
-- Only spawn a creature if there was a killer
if (event.killer == nil) then
return
end
-- Only spawn a creature if the killer was a player
if (event.killer:getPlayer() == nil) then
return
end
local team = TeamService.getTeam(event.killer:getPlayer())
-- Spawns a Skeleton creature allied with the killer's team
EntityService.spawnCreatureEntity(CreatureType.SKELETON, event.killer.getPosition(), team)
end)
function chase(player, entity)
while task.wait(0.1) do
if not player:getEntity() then
continue
end
entity:moveTo(player:getEntity():getPosition())
end
end
Events.BlockPlace(function(event)
if (event.blockType == ItemType.SLIME_BLOCK) then
local entity = EntityService.spawnImageEntity("rbxassetid://11467634330", event.position + Vector3.new(0,4,0))
entity:setCustomName("Gloop")
task.spawn(function()
chase(event.player, entity)
end)
end
end)
spawnImageEntity(image: string, position:):
Creates an using an image at the specified position. The string for the image parameter must be a . Use the returned object to further configure the entity.