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

'end' expected (to close 'while' at line 8) near '<eof>'??

Asked by 6 years ago
Edited 6 years ago

I made a script that would play audio when "E" is pressed and I get this error whenever I load the game.

'end' expected (to close 'while' at line 8) near '<eof>'

Any ideas how to fix this? Here is the script

local Fireing = false
local IsEquipped = false
local Clicking = false

local MouseTarget = false

Mouse.KeyUp:connect(function(key) if key == "e" then
while IsEquipped == true do
if IsEquipped == true and Clicking==true then
game.Workspace.Sound:Play(821439273)

end
0
Is this the whole script? If it is then, this isn't the script the error is coming from. It would come from line 113, but this script only has 26. Crazycat4360 115 — 6y
0
Sorry about that, edited it. Fangs020 2 — 6y
0
U need 2 ends at the bottom. KingLoneCat 2642 — 6y
0
Now it says 'end' expected (to close 'if' at line 7) near '<eof>' Fangs020 2 — 6y

1 answer

Log in to vote
0
Answered by
V4D3Z2 15
6 years ago
local Fireing = false
local IsEquipped = false
local Clicking = false

local MouseTarget = false

Mouse.KeyUp:connect(function(key) if key == "e" then
while IsEquipped == true do
if IsEquipped == true and Clicking==true then
game.Workspace.Sound:Play(821439273)
end
end

You forgot to put the "end" of your while loop.

Ad

Answer this question