Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does it say: 'end' expected (to close 'if' at line 3) near '< e o f >'?

Asked by 5 years ago

Script:

while true do PBL = workspace.Sound.PlaybackLoudness if PBL + 100 then game.Workspace.BlueAndRed.BrickColor = BrickColor,Blue() if PBL + 600 then game.Workspace.BlueAndRed.BrickColor = BrickColor.Red()

end

For some reason it says:

Workspace.BlueAndRed.Script:7: 'end' expected (to close 'if' at line 3) near '&lt; e o f >'

1
You must close the "if" statements with "end" richboifexekappa 89 — 5y
0
if; then; statements always need an "end" at the end of the statements. ALWAYS. killerbrenden 1537 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

this is what you are trying to do

while true do  
    wait(0.1) -- make sure to add wait() to while true do or it will crash
local PBL = workspace.Sound.PlaybackLoudness -- add local   

if PBL == 100 then   -- you have to have == you can do if PBL + 100 == 101 then
    game.Workspace.BlueAndRed.BrickColor = BrickColor,Blue() 
end -- make sure you close if statement with end

if PBL == 600 then  
    game.Workspace.BlueAndRed.BrickColor = BrickColor.Red()

    end
end
0
Does it have to stand in a local script? jamielelystad 20 — 5y
0
what? mattchew1010 396 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

Thank you!

First of all, please marked as answered for this answer if it helped. If you are not the asker and this still helps and u have a similar question, upvote always works!

Code

-- Debugged by VVickedDev
--Created by jamielelystad
while true do  
    wait(0.1) 
PBL = workspace.Sound.PlaybackLoudness
if PBL + 99 >=100 then
    game.Workspace.BlueAndRed.BrickColor = BrickColor.Blue() 
end

if PBL + 599 >= 600 then  
    game.Workspace.BlueAndRed.BrickColor = BrickColor.Red()
    end
end

Good To Go!

Hope this script helped you better understand your errors in Roblox Lua! I hope you get successful some day with your game!

0
Sadly does noting, thats for helping, you can aswell edit it if u see an problem in it, friend request me if you wanna see the game, thanks for helping, i'll look to other question about this! jamielelystad 20 — 5y
0
edit: I can't see any errors, but doesn't do anything jamielelystad 20 — 5y
0
game.Workspace.BlueAndRed.BrickColor = BrickColor.new("Really blue") vissequ 105 — 5y

Answer this question