wait(5)
game:GetService("TweenService"):Create(workspace.Car, TweenInfo.new(5, Enum.EasingStyle.Linear), {Position = Vector3.new(500.62, 155.521, 8.33)}):Play()
this is my code where it errors
wait(5)
game:GetService("TweenService"):Create(workspace.Car, TweenInfo.new(5, Enum.EasingStyle.Linear), {Position = Vector3.new(500.62, 155.521, 8.33)}):Play()
this is my code where it errors
you shouldnot repeat yourself when typing code
you should use task.wait() instead of wait as its more precise and doesnot throttle making it more performant + wait is deprecated
i think that you know for loops since you know vector3 values
you can replace
workspace.Car.Transparency = 0.9
wait(0.1)
workspace.Car.Transparency = 0.8
wait(0.1)
workspace.Car.Transparency = 0.7
wait(0.1)
workspace.Car.Transparency = 0.6
wait(0.1)
workspace.Car.Transparency = 0.5
wait(0.1)
workspace.Car.Transparency = 0.4
wait(0.1)
workspace.Car.Transparency = 0.3
wait(0.1)
workspace.Car.Transparency = 0.2
wait(0.1)
workspace.Car.Transparency = 0.1
wait(0.1)
workspace.Car.Transparency = 0
with
for i=0,1,0.1 do
workspace.Car.Transparency = i
task.wait(0.1)
end
here is a vid about loops
Format your code, use variables and multiple lines.
how do i even do that???
Or he could use TweenService, it’s much more effiecient.
Do what? You need to make your code readable. Putting it all on one line makes it unreadable.
i tried it keeps erroring, i dont think u understand.
if he want his transparency to be like 0.1,0.2,0.3 then tweenservice isnot for that tween service will increase the value smoothly like that 0.01,0.03,0.4 etc
Not if his starting value is 1 and in the property table the transparency is 0, It doesn’t matter which way.
wdym by that, i want it smooth but i say its laggy… please help
Learn the basics of ROBLOX and then you will figure it out. You cant get anywhere by being babied the whole way.
i already know basics, and i asked for help wdym babied
sorry if i took long time to reply i was converting a vid to mp4
the left cube is tween and the right one is for loop
if u want ur transparency to be not smooth then u canot do that with tween service and need for loop to make it not smooth
the script i used
local Tween = game:GetService("TweenService")
local For = workspace.For
local Twn = workspace.twn
task.wait(3)
Tween:Create(Twn,
TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.In),
{Transparency = 1}
):Play()
for i=0,1,0.1 do
For.Transparency = i
task.wait(0.2)
end
i tried it but it keeps erroring
ok you can use tween service for that
replace
workspace.Car.Transparency = 0.9
wait(0.1)
workspace.Car.Transparency = 0.8
wait(0.1)
workspace.Car.Transparency = 0.7
wait(0.1)
workspace.Car.Transparency = 0.6
wait(0.1)
workspace.Car.Transparency = 0.5
-- etc
with
local Tween = game:GetService("TweenService")
Tween:Create(workspace.car,
TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.In),
{Transparency = 1}
):Play()
what tween service does is that it will smoothly change the transparency
i sent it to show smt see the last script that i sent it should work
and i recommend you to learn loops and tween service as they are very important
did u read the forum rules???
the forum is made to ask for help he didnot make anything wrong
you should remove ur post as if someone reported it u may get banned and am being real
This isn’t appropriate, poly.
You should be guiding the learning developer, not shame him and bully him because of his pace of learning.
fine
the car is most likely a model so you want to do
for i, v in pairs(workspace.Car do
Tween:ServiceCreate(v,
TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.In),
{Transparency = 1}
):Play()
end
dont forget to declare tweenservice at the start of your code.
this will loop through the parts in your car and make them transparent. if you have parts in your car that arent parts, add if v:IsA("BasePart" then
after for i, v in pairs
.
take me away to banland, moderators!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.