Skip to content

Object properties

Every key self:set accepts, and what each one does. This is the same vocabulary as the Edit window — anything you can tick there, a script can write.

luau
self:set({
    color = "#55e38b",
    emissive = 1.5,
    light = true,
    light_radius = 12,
})

One call is one change, however many keys it carries, so batch them. Up to 32 keys per call.

Reading is one key at a time:

luau
local d = self:get("dynamic")

A key that was never written reads as nil, which means the engine's default — not zero, and not false.


Appearance

KeyTypeMeaning
colorcolourthe base colour
transparency0 – 10 is solid, 1 is invisible
metallic0 – 1how metal-like the surface is
roughness0 – 10 is a mirror, 1 is chalk
emissivenumberhow much light it gives off itself. Above 0 it glows
uv_repeat{u, v}how many times the texture tiles across the surface

Colours

luau
"#55e38b"           -- what every colour picker gives you
"#55e38baa"         -- with transparency
{ r = 0.3, g = 0.9, b = 0.5 }

Painting one face

A shape's faces can be painted individually:

luau
self:set({
    ["f0.color"] = "#ffffff",
    ["f1.transparency"] = 0.5,
})
ShapeFace numbers
box0 top, 1 front, 2 right, 3 back, 4 left, 5 bottom
cylinder, sphere0 top, 1 side, 2 bottom

A face with no override follows the object's own colour and transparency.


Light

An object can be a lamp.

KeyTypeMeaning
lightbooleanturns the light on. Absent = off
light_colorcolour
light_radius0 – 96how far it reaches, in metres. Absent = 8
light_intensity0 – 10brightness multiplier. Absent = 1
light_falloff0 – 2how quickly it fades to its limit. Absent = 1
light_cone0 – 900 lights every direction; above 0 makes a spotlight of that half-angle
light_shadowbooleanasks for a real shadow. Needs spare graphics budget

emissive and light are different things. emissive makes the object look bright; light makes it illuminate the things around it. A glowing sign wants the first. A lamp wants both.


Shadow and interiors

KeyTypeMeaning
cast_shadowbooleandoes it cast one?
receive_shadowbooleando shadows land on it?
block_sky_lightbooleandoes it count as a roof, keeping sky light out?
receive_indoor_darknessbooleandoes it darken when it is under a roof?
interior_darknessnumberhow dark it goes indoors

Physics

KeyTypeMeaning
collidebooleando players bump into it? Absent = true
dynamicbooleanis it a physics body? Absent = false
massnumberwhat it weighs, in kilograms
drag0 – 8how much the region's wind gets hold of it. Absent = 1
carrybooleanmay it be picked up?

self:set({ collide = false }) is how a door opens without moving.

dynamic = true makes an object fall, settle and be shoved. It is always solid — it overrides collide = false. Both read back as true or false, never nil.

mass and drag

Both only mean anything while dynamic is on.

mass is a crate at 30, a person at 70, a car at 1500. It decides who the region's wind can move and how two bodies shove each other. It does not change how fast something falls, and self:push stays deliberately mass-independent.

drag is a box at 1, a ball at about 0.5, a banner at 3 or more. drag = 0 is the opt-out: the weather never moves this object.

Weight alone does not decide who blows away. The acceleration the air gives is its force over the mass, and the force carries the object's area. That is why a five-kilo lead ball ignores a gale that carries a two-hundred-gram sheet across a field.


Health

KeyTypeMeaning
max_healthnumberwhat it counts down from
healthnumberwhat it has left

Setting max_health is what makes an object destructible. Without it, damage and heal refuse with "this object has no max_health", and that is how a world says which props are breakable and which are scenery.

health is writable because starting a tree at forty out of a hundred is the creator's decision, not a thing the engine should guess.


Outline

The "this one" mark — a rim drawn around the object.

KeyTypeMeaning
outlinebooleanturn it on
outline_colorcolour
outline_widthnumber
outline_effectstringhow it is drawn

An outline is a property of the object, not an effect on somebody's screen. That means one pass draws it for the editor and for scripts alike, and an object that is marked is marked for everyone who can see it.


Read-only

These exist on an object but a script cannot write them. Writing one answers nil, "read-only key" rather than quietly creating a field that does nothing.

shape · texture · material · script · particles · predict · bounds_min · bounds_max · part · owner · origin

particles is written only by self:particles.


Your own fields

Any key that is not on the lists above is yours. Write whatever you like:

luau
self:set({ open = true, mode = "stopped", visits = 12 })

These are what a predict rule tests with when, and what a HUD condition reads. They are how an object describes its own state in a way the engine can act on without waiting for your script.

They are not the same as self.store: properties are part of the object and replicate to everyone who can see it; the store is private memory that only your script reads.

See also

Hungrit scripting documentation.