repeat wait() until game:IsLoaded()
local srtv = 15
local endv = 6
local blur = script.Parent.Blur
function actBlur()
for i = srtv,endv,-1 do
wait(.5)
blur.Size = i
end
end
actBlur()
This is supposed to make it so when the game loads for the local player, the blur I’ve created shall go from 15 to 6 and go down by 1 every .5 seconds, it does not work for some reason, answers?
make some debug prints to make sure the repeat wait() actually passes, and that all your functions are running ideally. also i would do something like this instead
local However_Many_Times_You_Want = 20;
local Wait_Time = .5;
for x = 1,20 do wait(Wait_Time)
--code...
end
also i recommend using ‘TweenService’ for something like this instead of a for loop to make it more aesthetically pleasing
the first interval in the for loop is how much the loop is going up by. the second is the end goal. since your first number is 15, and the second 6, there is nothing to count to, as 15 >= 6.
what i mean is the first number is the interval in which goes up. for instance, if you had
for x = 2,4 do
it’d only run 2 times because 2 goes into 4 2 times
right, so originally you should add debug prints to make sure everything is working accordingly, especially within the loop as well. heres how id go about this however
im on my phone atm so sorry for all the errors lol! kind of hard to type this all
--local script
local Player = game.Players.LocalPlayer;
local Character = Player.Character or Player.CharacterAdded:Wait();
local Blur = Instance.new(“BlurEffect”, game.Lighting);
local Debris = game:GetService(“Debris”)
local TweenService = game:GetService(“TweenService”);
local Length = 3; -- 3 seconds
local Tweening_Info = TweenInfo.new(Length, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut);
local Goal = {
Size = 0;
};
repeat wait() until Character;
local Tween = TweenService:Create(Blur, Tweening_Info, Goal);
Tween:Play();
Debris:AddItem(Blur, Length);
correct me if im wrong on anything, phone is tough to type on
also, mb for not specifying why i didnt include the third increment, it usually defaults to 1, i forgot to mention that for the for loop.