Answered by
6 years ago Edited 6 years ago
Yes, you are able to put them into one script using the spawn function.
Here's more info on it. http://robloxdev.com/articles/Thread-Scheduler
Here's how I would do it:
05 | if script.Parent.V.Value = = 1 and Light.Value = = 1 then |
06 | script.Parent.Base.PointLight 2. Range = 18 |
07 | script.Parent.Humanoid.WalkSpeed = 30 |
18 | script.Parent.HumanoidRootPart.Steps:Stop() |
19 | script.Parent.Base.PointLight.Range = 0 |
20 | script.Parent.Base.PointLight 2. Range = 0 |
21 | script.Parent.Humanoid.WalkSpeed = 6 |
22 | script.Parent.V.Value = 1 |
23 | local Player = game:GetService( "Players" ).LocalPlayer |
24 | local stats = Player:WaitForChild( "leaderstats" ) |
25 | local Light = Player.leaderstats.Light |
26 | if script.Parent.V.Value = = 1 and Light.Value = = 1 then |
27 | script.Parent.Base.PointLight 2. Range = 18 |
28 | script.Parent.Humanoid.WalkSpeed = 30 |
30 | wait(math.random( 7 , 10 )) |
31 | script.Parent.V.Value = 0 |
32 | script.Parent.Base.PointLight.Range = 18 |
33 | script.Parent.Humanoid.WalkSpeed = 25 |
35 | if Light.Value = = 1 then |
36 | script.Parent.Humanoid.WalkSpeed = 6 |
37 | script.Parent.HumanoidRootPart.Anchored = true |
38 | script.Parent.HumanoidRootPart.Scream:Play() |
39 | script.Parent.HumanoidRootPart.Steps:Stop() |
41 | script.Parent.HumanoidRootPart.Steps:Stop() |
42 | script.Parent.HumanoidRootPart.Scream:Stop() |
43 | script.Parent.Base.PointLight.Range = 0 |
44 | script.Parent.Base.PointLight 2. Range = 0 |
46 | script.Parent.HumanoidRootPart.Anchored = false |
47 | script.Parent.Humanoid.WalkSpeed = 6 |
48 | script.Parent.V.Value = 1 |
EDIT: I forgot that return would stop it. I added an if statement to check when it loops.