Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

i made blackout script that wont work for some reason. why it wont work?

i made script that wont work

local fram = script.Parent.Parent.Parent.Parent.blockify.framblack1

script.parent.MouseButton1Click:Connect(function()
	wait(0.01)
	fram.BackgroundTransparency = 0.9
	wait(0.01)
	fram.BackgroundTransparency = 0.8
	wait(0.01)
	fram.BackgroundTransparency = 0.7
	wait(0.01)
	fram.BackgroundTransparency = 0.6
	wait(0.01)
	fram.BackgroundTransparency = 0.5
	wait(0.01)
	fram.BackgroundTransparency = 0.4
	wait(0.01)
	fram.BackgroundTransparency = 0.3
	wait(0.01)
	fram.BackgroundTransparency = 0.2
	wait(0.01)
	fram.BackgroundTransparency = 0.1
	wait(0.01)
	fram.BackgroundTransparency = 0
	wait(0.01)
	fram.BackgroundTransparency = 0.1
	wait(0.01)
	fram.BackgroundTransparency = 0.2
	wait(0.01)
	fram.BackgroundTransparency = 0.3
	wait(0.01)
	fram.BackgroundTransparency = 0.4
	wait(0.01)
	fram.BackgroundTransparency = 0.5
	wait(0.01)
	fram.BackgroundTransparency = 0.6
	wait(0.01)
	fram.BackgroundTransparency = 0.7
	wait(0.01)
	fram.BackgroundTransparency = 0.8
	wait(0.01)
	fram.BackgroundTransparency = 0.9
	wait(0.01)
	fram.BackgroundTransparency = 1
end)

1 answer

You could just use TweenService.

local FRAME = script.Parent.Parent.Parent.Parent.blockify.framblack1
script.Parent.MouseButton1Click:Connect(function() -- parent cannot be used; use Parent instead
     local tween = game:GetService("TweenService"):Create(FRAME, TweenInfo.new(1, Enum.EasingStyle.Linear), {BackgroundTransparency = 0})
     tween:Play() -- play the tween
     tween.Completed:Wait() -- wait for the tween to be completed, screen is black now
end)

1 comment

0

wont work for some reason

This discussion is preserved as it was. New answers, comments, and votes are closed.