Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Increasing PlayBackSpeed by a "while" loop?

Hello! I'm making an airplane and since BETA version was deleted I have to enable sound effects manually. I've looped the following script to increase little by little the PlayBackSpeed (pitch) This is the script

while true do
	game.Players.LocalPlayer.Character.Plane.Mainparts.Normal.PlayBackSpeed = game.Players.LocalPlayer.Character.Plane.Mainparts.Normal.PlayBackSpeed + 0.01
	end

There are no errors on the script. When it is runing, nothing happens and output remains empty. Any help?

2 comments

0

Are you sure that doesn't crash the game? Do you have a wait anywhere within the loop?

0

There doesn't seem to be any errors. Maybe check the properties of the sound to see if something is off. ^^ Also stated above, you have no wait

1 answer

Where is this local script located? Local scripts only run in workspace if they are a descendant of the local player's character.

From the wiki:

A LocalScript will only run Lua code if it is a descendant of one of the following objects:

  • A Player’s Backpack, such as a child of a Tool
  • A Player’s character model
  • A Player’s PlayerGui
  • A Player’s PlayerScripts.
  • The ReplicatedFirst service

https://developer.roblox.com/en-us/api-reference/class/LocalScript

You should receive a "Game Script Timeout" error if the script runs, because your while loop does not have a wait().

This discussion is preserved as it was. New answers, comments, and votes are closed.