Skip to content

Các lớp đối tượng ​

Mọi lớp một world có thể chứa, kèm thành viên của chúng. Tạo bằng new("ClassName", parent) hoặc Insert Object của KHIM Engine. Tên PascalCase kiểu Roblox của cùng thành viên cũng chạy.

Mọi đối tượng ​

Thành viên
name, className, parent
find(name), waitFor(name, timeout?), findByClass(className), children(), isA(className)Tìm kiếm
clone(), destroy(), destroyAfter(seconds)
tween(goals, time or options)Part, UI, Lighting, camera
addTag, removeTag, hasTag, getTagsTag
setAttribute, getAttribute, getAttributes, attributes, attributeChanged, getAttributeChangedSignal(name)Attribute

Part ​

Part ​

position, rotation, transform, size, color, transparency, anchored, canCollide, shape, material, velocity, group, mesh, texture (chỉ đọc); touched(part), touchEnded(part); applyImpulse(force), loadAnimation(animation) (một rig).

Spawn - Part người chơi xuất hiện trên đó. MeshPart - Part hiển thị một model 3D (mesh).

Model, Folder ​

Nhóm. Model di chuyển và sao chép như một; new("Model") tạo một Model. Folder để giữ gọn gàng.

Người chơi ​

Player ​

name, displayName, userId, team, neutral, position, health, maxHealth, walkSpeed, jumpPower, stats, backpack, character, gui, characterModel; died; teleport(position), damage(amount), kick(reason?), equipTool(tool), unequipTools().

Character ​

body (một Body), root (một RootPart); moveTo(position), pivotTo(transform).

Body ​

health, maxHealth, walkSpeed, jumpPower, sitting, state; died, stateChanged(new, old); damage(amount), loadAnimation(animation), getPlayingAnimationTracks(); idleAnimation, walkAnimation, jumpAnimation, fallAnimation, climbAnimation.

RootPart ​

position, transform, size, velocity.

Tool ​

enabled, toolTip; activated, equipped, unequipped. Part tên Handle được cầm trên tay.

Team ​

color, autoAssignable; getPlayers().

Trên part ​

LớpThành viên
ClickablemaxDistance; clicked(player)
Prompttext, key, maxDistance, enabled; triggered(player)
Billboardtext, textColor, textSize, offset, maxDistance, backgroundColor, backgroundTransparency, enabled
Signtext, face, textColor, fit, textHeight, textAlign, backgroundColor, backgroundTransparency, transparency, enabled
SoundsoundId, volume, looped, playing; play(), stop() (cũng đặt được trong world)
Lightcolor, brightness, range, angle, innerAngle, direction, enabled
Decalimage, color, transparency, face
TextureDecal lặp lại: tileSize, tileOffset
HighlightfillColor, fillTransparency, outlineColor, outlineTransparency, depthMode ("AlwaysOnTop", "Occluded"), enabled
Beampart1, anchor, anchor1, color, transparency, width0, width1, enabled
Trailcolor, transparency, width0, width1, lifetime, enabled
Zoneenabled; entered(player), left(player), partEntered(part), partLeft(part); players(), parts(), contains(what)
ParticleEmitterrate, lifetime, speed, size, color, transparency, texture, spreadAngle, direction, acceleration, drag, lightEmission, lockedToPart, shape, turbulence và nhiều nữa; emit(count?)
ParticleForcemode ("Attract", "Vortex", "Wind", "Turbulence"), strength, radius, falloff, direction, frequency, enabled
EffectPhát mọi hạt trên part của nó và bên trong như một: play(), stop(), clear()

Gameplay (không cần script) ​

LớpThành viên
Teleporterdestination, enabled; triggered(player), teleported(player)
Hazarddamage, enabled; triggered, hurt
Checkpointenabled; triggered, reached
Pickupstat, amount, respawnTime, enabled; triggered, collected
BoostwalkSpeed, jumpPower, duration, enabled; triggered, boosted
Motionmove, turn, pivot, time, pause, delay, reverses, looped, smooth, relative, enabled; arrived, triggered; restart()
Spawnertemplate, interval, limit, lifetime, velocity, relative, count, enabled; spawned(part); spawn(), clear()
Seatoccupant, enabled; sat(player), left(player); sit(player), stand()
VehicleSeatGhế lái các Hinge có motor trong Model của nó: maxSpeed, torque, turnSpeed, throttle, steer

Khớp nối và lực đẩy ​

LớpThành viên
Hingepart1, anchor, axis, enabled, limited, lower, upper, motor, speed, force, angle (chỉ đọc)
SliderNhư Hinge, có offset (chỉ đọc) thay cho angle
BallJointpart1, anchor, axis, enabled
Springpart1, anchor, anchor1, length, stiffness, damping, currentLength
Ropepart1, anchor, anchor1, length, currentLength
Boneholder, anchor, angles, offset, enabled
Movervelocity, strength, relative, enabled
Spinnerspin, strength, relative, enabled
Thrusterforce, relative, enabled

Value và tin nhắn ​

LớpThành viên
IntValue, NumberValue, StringValue, BoolValuevalue; changed(new)
ObjectValuevalue (một part, đối tượng hay người chơi); changed
Vector3Value, Color3Valuevalue; changed
BindableEventfire(...); event
BindableFunctiononInvoke; invoke(...)
Timerinterval, repeats, oneShot, running, timeLeft; fired; start(), stop()
RemoteEvent, RemoteFunctionCủa Roblox: FireServer, FireClient, OnServerEvent... Script KHIM dùng net

Animation ​

LớpThành viên
Animationkeyframes (nội dung clip), looped, length (chỉ đọc), preset
AnimationTrackplay(fade?, weight?, speed?), stop(fade?), adjustSpeed(speed), speed, looped, playing, length, timePosition, animation; stopped, ended

Cài đặt của world ​

Lớp
Collision groupsBảng nhóm nào va chạm với nhóm nào của world - sửa trong Inspector
Camera settingsCamera của người chơi bắt đầu thế nào: mode, minZoom, maxZoom, fov, firstPersonArms, offset (script đọc được; đổi camera bằng camera)

UI ​

LớpThành viên
Canvasvisible
Panelposition, size, anchor, backgroundColor, backgroundTransparency, visible, zIndex, layoutOrder
ScrollPanelMột Panel: canvasSize, canvasPosition, automaticCanvasSize, scrollBarThickness, scrollingEnabled
LabelMột Panel: text, textColor, textSize, textAlign, textWrapped, textScaled, font
ButtonMột Label: clicked
TextInputMột Label: placeholder; focusLost(enterPressed)
ImageMột Panel: image, imageColor, imageTransparency
ImageButtonMột Image: clicked
ProgressBarMột Panel: value, min, max, fillColor
SliderInputProgressBar người chơi kéo được: step; changed(value)
ToggleMột Label: checked, fillColor; changed(checked)
ListLayoutdirection, padding, alignX, alignY, sortOrder
GridLayoutcellSize, cellPadding, sortOrder
Paddingtop, bottom, left, right
Cornerradius
Bordercolor, thickness, transparency, applyTo ("Border", "Text")
Gradientcolor0, color1, colorMid, midpoint, transparency0, transparency1, rotation, enabled
AspectRatioaspectRatio, aspectType, dominantAxis
Scalescale
SizeLimitminSize, maxSize
TextSizeLimitminTextSize, maxTextSize

Script ​

Script, ClientScript, Module - xem Cơ bản về script.