我该如何闪烁灯光?

时间:2020-10-28 15:38:56

标签: flicker

好吧,所以在roblox中,我一直试图发出闪烁的灯光,但似乎不起作用。因此,我尝试查找第一行中的错误,但是..它似乎不起作用,而且我似乎也找不到。

while true do
    math.randomseed(tick())
    local Brightness = math.random(0.1 , 1)
    local Light = script.Parent
    local SpotLight = Light.SL
    local RandomPause = (math.random(0.5 , 5))
    wait(RandomPause)
    SpotLight.Brightness = Brightness
    wait (RandomPause)
    SpotLight.Brightness = Brightness
end

1 个答案:

答案 0 :(得分:0)

  1. 将聚光灯插入零件

  2. 将此脚本插入到该部分中:

    local spotlight = game.Workspace.Light.SpotLight
    
    while true do 
    spotLight.Enabled = true
    wait(2)
    spotLight.Enabled = false
    wait(0.1)
    spotLight.Enabled = true
    wait(0.3)
    spotLight.Enabled = false
    wait(0.5)
    
    end
    
    

您可以根据需要编辑“等待(时间)”,以加快或减慢闪烁。