so i have a script that should tween a gui transparensybackground from 1 to 0 and then back to 1
but the second tween to go back to 1 doesnt work. the output doesnt give any errors.
i dont know what i did wrong. i would appriciate any help.
this is the script i have:
local click = game.Workspace["High rank Meeting room"]["Self Destruct"]["Self Destruct Initiate"].Button.btn.ClickDetector
function Explode(player)
click.MaxActivationDistance = 0
wait(119)
wait(5)
warn("Room getting Exlploded")
local TweenService = game:GetService("TweenService")
local gui = script.Parent
local goal = {}
goal.BackgroundTransparency = 0
local tweenInfo = TweenInfo.new(
3, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
local tween = TweenService:Create(gui, tweenInfo, goal)
tween:Play()
wait(2)
local notkicked = {}
local nokickpart = game.Workspace.NoKickPart
nokickpart.Touched:Connect(function() end)
local parts = game.Workspace.NoKickPart:GetTouchingParts()
for _, part in next, parts do
if part.Parent:FindFirstChild("Humanoid") then
if not table.find(notkicked, part.Parent.Name) then
table.insert(notkicked, part.Parent.Name)
for _, items in pairs(notkicked) do
warn(items)
end
end
end
end
for i,v in pairs(game.Players:GetChildren()) do
if table.find(notkicked, v.Name) then
elseif not table.find(notkicked, v.Name) then
v:Kick("???")
end
end
local tween2 = TweenService:Create(gui, TweenInfo.new(3), {BackgroundTransparency = 1})
wait(2)
tween2:Play()
end
click.MouseClick:Connect(Explode)
it also kicks every person thats not touching a part. but that part works fine.