Skip to content
6 changes: 1 addition & 5 deletions content/en-us/sound/objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,7 @@ sound:Play()
-- Start checking if emitter should be enabled
RunService.Heartbeat:Connect(function()
-- Enable the emitter within a time range of the audio; otherwise disable it
if sound.TimePosition >= 5 and sound.TimePosition < 20 then
emitter.Enabled = true
else
emitter.Enabled = false
end
emitter.Enabled = sound.TimePosition >= 5 and sound.TimePosition < 20
end)
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,7 @@ Use the array size to check when it's time to cycle back to the first piece of d
local dialogue = dialogueArray[dialogueIndex]
Chat:Chat(head, dialogue)

if dialogueIndex == #dialogueArray then
dialogueIndex = 1
else
dialogueIndex += 1
end
dialogueIndex = if dialogueIndex == #dialogueArray then 1 else dialogueIndex + 1
end
```

Expand Down Expand Up @@ -239,12 +235,7 @@ This script used an array to create a list of possible dialogue lines for a Non-
local dialogue = dialogueArray[dialogueIndex]
Chat:Chat(head, dialogue)

if dialogueIndex == #dialogueArray then
dialogueIndex = 1

else
dialogueIndex += 1
end
dialogueIndex = if dialogueIndex == #dialogueArray then 1 else dialogueIndex + 1
end

prompt.Triggered:Connect(speak)
Expand Down
Loading