概要
robloxでassistantやってみた。
練習問題やってみた。
練習問題
Trailを使え。
手順
- ServerScriptServiceに、scriptを追加。
- スクリプトを書く。
local TweenService = game:GetService("TweenService")
local part = Instance.new("Part")
part.Material = Enum.Material.Neon
part.Size = Vector3.new(1, 1, 1)
part.Shape = Enum.PartType.Ball
part.Position = Vector3.new(0, 5, 0)
part.Anchored = true
part.Parent = workspace
local attachment0 = Instance.new("Attachment")
attachment0.Name = "Attachment0"
attachment0.Position = Vector3.new(0, -0.5, 0)
attachment0.Parent = part
local attachment1 = Instance.new("Attachment")
attachment1.Name = "Attachment1"
attachment1.Position = Vector3.new(0, 0.5, 0)
attachment1.Parent = part
local trail = Instance.new("Trail")
trail.Attachment0 = attachment0
trail.Attachment1 = attachment1
local color1 = Color3.fromRGB(255, 255, 255)
local color2 = Color3.fromRGB(255, 255, 255)
trail.Color = ColorSequence.new(color1, color2)
trail.Parent = part
local dir = 15
while true do
dir *= -1
local goal = {
Position = part.Position + Vector3.new(0, 0, dir)
}
local tweenInfo = TweenInfo.new(3)
local tween = TweenService:Create(part, tweenInfo, goal)
tween:Play()
task.wait(4)
end
写真
以上。