例如:脚本在一个游戏会话中运行良好,但在另一个游戏会话中,它根本不起作用;几乎就好像脚本有某种随机机会被删除或完全忽略。如果我删除去抖动,脚本有 100% 的机会再次工作。这里可能出了什么问题?
local radius = script.Parent
local light = radius.Parent.Light
local sound = radius.Parent.lighton
local debounce = false
radius.Touched:connect(function(hit)
if debounce == false then debounce = true
if game.Players:GetPlayerFromCharacter(hit.Parent) then
light.PointLight.Brightness = 10
light.Material = "Neon"
sound:Play()
wait(5.5)
light.PointLight.Brightness = 0
light.Material = "Plastic"
sound:Play()
wait(0.5)
debounce = false
end
end
end)