So I made a GUI object and have a object in it flash, however only when it is equipped to prevent lag of course. And the script gives no errors and no response either. Any help?
local TweenService = game:GetService("TweenService")
local CH_Info = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local CH_Properties = {
Size = UDim2.new(0, 400,0, 200),
ImageTransparency = 1,
ImageColor3 = Color3.fromRGB(117, 117, 117)
}
local GUI = script.Parent:WaitForChild("GunClient"):WaitForChild("GunGUI")
ShouldFlash = false
while true do
if ShouldFlash == true then
local Clone = GUI.Frame.BG:Clone()
Clone.Parent = script.Parent.Parent
local Tween = TweenService:Create(Clone, CH_Info, CH_Properties)
Tween:Play()
Tween.Completed:Wait()
Clone:Destroy()
end
task.wait(1.25)
end
script.Parent.Equipped:Connect(function()
ShouldFlash = true
end)
script.Parent.Unequipped:Connect(function()
ShouldFlash = false
end)
Why are you cloning it? Why not do it straight to the GUI.Frame.BG?
It could be because they are overlapping, and that it is actually flashing, but one of them is on top / under.