Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

simple blackout script wont work for some reason? help pls

Asked by 4 years ago

script i made simple that any simple scripts but it wont work for some reason please help

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)
0
Can you tell me more about the script? Is it a local script? Where is it located? rabbi99 714 — 4y
0
Does it print any errors? rabbi99 714 — 4y
0
that would go nearly instant, add a print and see if the events gets fired at all VerdommeMan 1479 — 4y
0
it local script location is Startergui.ScreenGui.frammain.play.blackify (script) MagicPineappleLOLKA -6 — 4y

1 answer

Log in to vote
0
Answered by
Sindrotex -41
4 years ago
Edited 4 years ago

I recommend you use the TweenService service, way more clean and easy to do. (Also, you have "script.parent", pretty sure that doesn't work, as it's "script.Parent")

local fram = script.Parent.Parent.Parent.Parent.blockify.framblack1
local TweenService = game:GetService("TweenService")
local tweenDictionary = {Transparency = 1}
local newTween = TweenService:Create(fram, TweenInfo.new(3), tweenDictionary)

script.Parent.MouseButton1Click:Connect(function()
    newTween:Play()
end)
Ad

Answer this question