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

Getting expected end errors or expected <eof> errors, what happened?

Asked by
Raccoonyz 1092 Donator Moderation Voter
4 years ago

I have been encountering a issue where I keep getting issues and I don't know what's going on at all. Help.

-- plugin created by the legendary raccoon man Raccoonyz
-- enjoy!!
local toolbar = plugin:CreateToolbar("Find Part Number")

-- Add a toolbar button named "Create Empty Script"
local newScriptButton = toolbar:CreateButton("Find Part Number", "Finds the number of parts", "rbxassetid://1557174359")

local function onNewScriptButtonClicked()
local model = game.Selection:Get()[1]
if model == nil then
local gui = Instance.new("ScreenGui")
gui.Parent = game.CoreGui
local meshgui = Instance.new("TextLabel")
meshgui.Parent = gui
gui.Name = "Error"
meshgui.Position = UDim2.new(0.189, 0, 0.23, 0)
meshgui.Size = UDim2.new(0, 200, 0, 47)
meshgui.Text = "Error: nothing is selected"
wait(2)
gui:Destroy()
return
end
local descend = model:GetDescendants()
local partnumber = 0
local meshpart = 0
local ttmeshpart = 0
for index, descendant in pairs(descend) do
    if descendant.ClassName == "Part" or descendant.ClassName == "WedgePart" then
        partnumber = partnumber + 1
        end
if descendant.ClassName == "UnionOperation" then
        partnumber = partnumber + 1
        meshpart = meshpart + 1
        end
if not descendant == nil then 
 return
end
end
print("Parts: "..partnumber)
print("Mesh Parts: "..meshpart)
local gui = Instance.new("ScreenGui")
gui.Parent = game.CoreGui
local meshgui = Instance.new("TextLabel")
local partgui = Instance.new("TextLabel")
local exit = Instance.new("TextButton")
local partmeshgui = Instance.new("TextLabel")
exit.Parent = gui
meshgui.Parent = gui
partgui.Parent = gui
partmeshgui.Parent = gui
gui.Name = "PartCounter"
meshgui.Position = UDim2.new(0.189, 0, 0.23, 0)
partgui.Position = UDim2.new(0.189, 0, 0.142, 0)
partmeshgui.Position = UDim2.new(0.189, 0, 0.319, 0)
--{0.189, 0},{0.319, 0}
partgui.Size = UDim2.new(0, 200, 0, 47)
meshgui.Size = UDim2.new(0, 200, 0, 47)
partmeshgui.Size = UDim2.new(0, 200, 0, 47)
meshgui.Text = "Unions: "..meshpart
partgui.Text = "Parts: "..partnumber
partmeshgui.Text = "Part Meshes: "..ttmeshpart
exit.Text = "X"
exit.Name = "Exit"
exit.Size = UDim2.new(0, 41, 0, 47)
exit.Position = UDim2.new(0.345, 0, 0.142, 0)
game.CoreGui.PartCounter.Exit.MouseButton1Click:Connect(leftClick2)
newScriptButton.Click:Connect(onNewScriptButtonClicked)
end
function leftClick2()
    local gui = game.CoreGui.PartCounter
    gui:Destroy()
end
0
Which line does the error mention? ankurbohra 681 — 4y
0
that one doesn't mention an error, but anything I do doesn't work. I'm highly confused Raccoonyz 1092 — 4y
0
it was working earlier but now it doesn't Raccoonyz 1092 — 4y
0
There’s no error? ankurbohra 681 — 4y
View all comments (2 more)
0
It doesn't output a error but it doesn't work Raccoonyz 1092 — 4y
0
It's the way you have your lines, you have most of your ends on the same vertical line, try spacing them out maybe?? panichub 29 — 4y

Answer this question