Helicopter Blades

no joke i actually used to do that with scripts lol.

But also i didn’t come to argue i just wanted to help some people out because i now the great help others have given me

1 Like

No, no, no!
Use loops, don’t repeat code!

function NoiseSpeedUp()
script.Parent.PlaybackSpeed = 0.4
    for i = 0.4, 1, 0.1 do --This gradually increases the playback speed
        script.Parent.PlaybackSpeed = i
    wait(0.5)
    end
end)

Blades, assuming its a model:

local Blades = workspace.Helicopter.Blades --path to blades here
local BladeSpeed = 0
game["Run Service"].Heartbeat:Connect(function() -- not tested
     Blades:SetPrimaryPartCFrame(Blades.PrimaryPart.CFrame * CFrame.Angles(0,BladeSpeed)
     if BladeSpeed <= 5 then
            BladeSpeed += 0.1 
     end
end)
3 Likes

I’m pretty sure were all here to help people, I just don’t think we should give minimum effort, bad code for people to learn from.

I know there a million ways i could do this better. so i will learn from this thanks you

1 Like

I think that’s fixed now anyone know about the blades?

Well i would also still consider my self in the middle of advanced and begginner because i know some things and i dont know others

As @synical4 said earlier, I would recommend using TweenService to gradually increase the speed of your Helicopter Blades.

I would use a mesh with the blades of the helicopter. Weld it to the helicopter, and use the link I sent refering to tweenservice to try and tween its rotation faster and faster. A for loop @Phazenine sent earlier would work really well too.

Tween Service

Guys so it’s fixed new problem that I forgot that the text when I send it doesn’t like show with previous texts,like there isn’t any previous texts.

No joke this is what I do with scripts rn…

Could you show me the more effective way you are talking about? It could really help me.
(Notice how programmer is the secondary tag :joy:)

1 Like

Ye sure https://gyazo.com/6d85b14ab582609346eec20893361ecb
That won’t come up when you send a text

We can simply loop x amount of times to achieve a goal. To do this, we use this method:

for i = Start,End,Increase do
end

Basically, we create a loop with the number we want to start at, the number we want to end at and how much that will increase each loop. Lets create a simple count from 1 to 10:

for currentNumber = 0, 10, 1 do
   print(currentNumber)
   wait(1)
end
-- This code will take 10 seconds, and print numbers 1 - 10.

Hopefully this made sense. If not, let me know, I can try to detail it more.

I didn’t understand,what I need is a script to show the text history.

What? I wasn’t even replying to you, I was answering someone else’s question :sweat_smile:

1 Like

Ahh so how would it work with your earlier “hello” example? Wouldn’t you still have to define each individual letter?

The earlier code: [quote=“SpacePuppy2, post:20, topic:1222523”]

text = "H"
wait(1)
text = "He"
wait(1)
text = "Hel"
wait(1)
text = "Hell"
wait(1)
text = "Hello"

[/quote]

1 Like

No like on the example map the texting history comes up but on my map it doesn’t

Oh I was talking to spacepuppys2. Not you sorry. I can try to help in a minute…

1 Like

I’m assuming the helicopter is going to be an active physics object, flying around the game. You don’t want to mix TweenService and active physics objects. For engine startup I would join the blades to the helicopter with a HingeConstraint. Set it’s ActuatorType to Motor, then gradually increase the AngularVelocity until the blades are spinning decently fast. I would then remove the blades and replace them with a single flattened cylinder that has a texture giving the illusion of blades. You could spin this cylinder along the same HingeConstraint.

This approach is very common, even in AAA games. Around 4 seconds into this video of Battlefield 4’s helicopter starting up; you can see the exact moment they switched between the high fidelity 4 bladed mesh, and the low fidelity spinning textured cylinder.

1 Like

Not exactly. It behaves very similarly, just uses a function called string.sub. If you want to learn more, I believe the DevHub has an article on it.

Anyways, lets make a text loop:

local text = "Some Text!"

for i = 1, #text, 1 do
    TextLabel.Text = string.sub(text, 1, i)
    wait(0.5) --This is the speed of the text. At the moment, this moves slowly but it can go faster.
end

We simply use a new thing in Lua, the # symbol. Say we have a piece of text that is 5 characters long. #text would print 5. So, we loop through every character and add one, each time. I believe this script should work although it may have to be altered.

1 Like

strings are actually just arrays.

local h = 'Hello'

for i = 1, #h do
    print(string.sub(h, 1, i))
    wait()
end
2 Likes