ROBLOX - 试图获得我想要的效果?

时间:2015-10-25 16:21:28

标签: lua roblox

对于模糊的标题感到抱歉,我不知道如何解释我想要做的事情。

我试图复制一个"从ROBLOX游戏中选择"(?)效果shown here

除了一个问题外,我基本上完全一样。它每次都停在同一个部位(顶部)。在这里发布是我目前的最后一招(roblox的脚本子论坛非常不活跃)

for i = 1, 3 do
    for _, ll in pairs(P:GetChildren()) do
        lastbcolor = ll.BrickColor
        ll.BrickColor = BrickColor.Yellow()
        wait(t)
        ll.BrickColor = lastbcolor
        lastpicked = ll
        print(t)
        t=t+0.2 -- to slow down
    end
end

1 个答案:

答案 0 :(得分:1)

math.randomseed(os.time())
local t = P:GetChildren()
local N = #t                  -- number of menu items
local K = 1
for R = 20 + math.random(N), 1, -1 do
  ll = t[K]
  local lastbcolor = ll.BrickColor
  ll.BrickColor = BrickColor.Yellow()
  wait( R^-.7*.7 )
  ll.BrickColor = lastbcolor
  K = K % N + 1
end
ll = t[K]
-- blink 
for R = 1, 5 do
  local lastbcolor = ll.BrickColor
  ll.BrickColor = BrickColor.Yellow()
  wait( .3 )
  ll.BrickColor = lastbcolor
  wait( .3 )
end