local frame = script.Parent
local plr = game.Players.LocalPlayer
script.Parent.Parent.Enabled = false
plr.Chatted:Connect(function(msg)
if msg == "mr. kitty" or "kitty" then
script.Parent.Parent.Enabled = true
for i = 1,100 do
frame.BackgroundTransparency -= 0.05
wait (0.01)
end
end
end)
and it makes a frame on screen go from 0 transparency to 1 after a word is said in chat (which works perfectly fine.) now i’m trying to make it go from 1 to 0 transparency right after the first thing finishes like a blink. ive tried adding a wait and then doing ‘+= 0.05’ and it doesn’t work. can somebody help? thx
local tweenInfo = TweenInfo.new(
1, -- the length of time it takes to complete the tween
Enum.EasingStyle.Sine, -- the tweening EasingStyle (the way it transitions)
Enum.EasingDirection.InOut, -- the tweening EasingDirection (the direction that it tweens in)
0, -- how many times it should repeat itself
true, -- **this is what you want**; when the tween is finished, it'll go in reverse back to the default (original) value
0 -- the delay in which the tween will take (How long the code will wait before playing the tween)
)
local tween = game:GetService("TweenService"):Create(
frame, -- the object to be tweened
tweenInfo, -- the tween information to read from (the thing that was previously defined)
{
BackgroundTransparency = 0 -- the property to be tweened and its end value
}
)
tween:Play() -- plays the tween
local frame = script.Parent
local plr = game.Players.LocalPlayer
script.Parent.Parent.Enabled = false
plr.Chatted:Connect(function(msg)
if msg == "kitty" then
script.Parent.Parent.Enabled = true
local tweenInfo = TweenInfo.new(
1, -- the length of time it takes to complete the tween
Enum.EasingStyle.Sine, -- the tweening EasingStyle (the way it transitions)
Enum.EasingDirection.InOut, -- the tweening EasingDirection (the direction that it tweens in)
0, -- how many times it should repeat itself
true, -- **this is what you want**; when the tween is finished, it'll go in reverse back to the default (original) value
0 -- the delay in which the tween will take (How long the code will wait before playing the tween)
)
local tween = game:GetService("TweenService"):Create(
frame, -- the object to be tweened
tweenInfo, -- the tween information to read from (the thing that was previously defined)
{
BackgroundTransparency = 0 -- the property to be tweened and its end value
}
)
tween:Play() -- plays the tween
end
end)
so here is what i have, it’s giving an error for the ’local tween = game:GetService(“TweenService”):Create(
frame,'
part which is "MultiLineStatement: (18,3) Statement spans multiple lines; use indentation to silence"