Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo(?) in Loadstring's LuaY #1586

Closed
Mars7383 opened this issue Aug 16, 2024 · 2 comments · Fixed by #1587
Closed

Typo(?) in Loadstring's LuaY #1586

Mars7383 opened this issue Aug 16, 2024 · 2 comments · Fixed by #1587
Labels
🐛 bug Bugs or broken features 🎏 miscellaneous Miscellaneous content

Comments

@Mars7383
Copy link
Contributor

Version channel

Stable (Default)

Loader version

No response

What part of Adonis is this related to?

Other

What happened?

I ran this code with :ss

local function Deserialize(Class, Properties)
	local Instance_ = Instance.new(Class)
	for Key, Value in pairs(Properties) do
		Instance_[Key] = Value
	end
	return Instance_
end
	
local Example_var = Deserialize('ScreenGui',{DisplayOrder=0,Enabled=true,ResetOnSpawn=true,Name='Example', Parent=game:GetService("StarterGui")})
local Background_var = Deserialize('Frame',{Style=Enum.FrameStyle.Custom,Active=false,AnchorPoint=Vector2.new(0, 0),BackgroundColor3=Color3.new(0.941176, 0.941176, 0.94902),BackgroundTransparency=0,BorderColor3=Color3.new(0, 0, 0),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.12837109, 0, 0.139146566, 0),Rotation=0,Selectable=false,Size=UDim2.new(0, 688, 0, 389),SizeConstraint=Enum.SizeConstraint.RelativeXY,Visible=true,ZIndex=1,Name = 'Background',Parent = Example_var})
local MainContent_var = Deserialize('Frame',{Style=Enum.FrameStyle.Custom,Active=false,AnchorPoint=Vector2.new(0, 0),BackgroundColor3=Color3.new(1, 1, 1),BackgroundTransparency=0,BorderColor3=Color3.new(0, 0, 0),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.138081402, 0, 0.0796915144, 0),Rotation=0,Selectable=false,Size=UDim2.new(0, 497, 0, 198),SizeConstraint=Enum.SizeConstraint.RelativeXY,Visible=true,ZIndex=1,Name = 'MainContent',Parent = Background_var})
local UICorner_var = Deserialize('UICorner', {Name = 'UICorner', Parent = MainContent_var, CornerRadius = UDim.new(0, 8)})
local Title_var = Deserialize('TextLabel',{Font=Enum.Font.SourceSansBold,FontSize=Enum.FontSize.Size14,Text='Example Domain',TextColor3=Color3.new(0, 0, 0),TextScaled=true,TextSize=14,TextStrokeColor3=Color3.new(0, 0, 0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Center,Active=false,AnchorPoint=Vector2.new(0, 0),BackgroundColor3=Color3.new(1, 1, 1),BackgroundTransparency=0,BorderColor3=Color3.new(0, 0, 0),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.0342052318, 0, 0.157407403, 0),Rotation=0,Selectable=false,Size=UDim2.new(0, 210, 0, 37),SizeConstraint=Enum.SizeConstraint.RelativeXY,Visible=true,ZIndex=1,Name='Title',Parent = MainContent_var})
local Body_var = Deserialize('TextLabel',{Font=Enum.Font.SourceSans,FontSize=Enum.FontSize.Size18,Text='This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.',TextColor3=Color3.new(0, 0, 0),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0, 0, 0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Top,Active=false,AnchorPoint=Vector2.new(0, 0),BackgroundColor3=Color3.new(1, 1, 1),BackgroundTransparency=0,BorderColor3=Color3.new(0, 0, 0),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.0342052318, 0, 0.428030312, 0),Rotation=0,Selectable=false,Size=UDim2.new(0, 465, 0, 41),SizeConstraint=Enum.SizeConstraint.RelativeXY,Visible=true,ZIndex=1,Name='Body',Parent = MainContent_var})
local Extra_var = Deserialize('TextLabel',{Font=Enum.Font.SourceSans,FontSize=Enum.FontSize.Size18,Text='More information...',TextColor3=Color3.new(0.219608, 0.282353, 0.560784),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0, 0, 0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Top,Active=false,AnchorPoint=Vector2.new(0, 0),BackgroundColor3=Color3.new(1, 1, 1),BackgroundTransparency=0,BorderColor3=Color3.new(0, 0, 0),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.0342052318, 0, 0.690235615, 0),Rotation=0,Selectable=false,Size=UDim2.new(0, 129, 0, 22),SizeConstraint=Enum.SizeConstraint.RelativeXY,Visible=true,ZIndex=1,Name='Extra',Parent = MainContent_var})

--[[ some extra stuff to trigger the 200+ local variables error ]]
local Junk_var = Deserialize('Folder', {Name = 'Junk', Parent = Example_var })
local TextButton_var = Deserialize('TextButton',{Font=Enum.Font.Legacy,FontSize=Enum.FontSize.Size8,Text='Button',TextColor3=Color3.new(0.105882, 0.164706, 0.207843),TextScaled=false,TextSize=8,TextStrokeColor3=Color3.new(0, 0, 0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=Enum.TextXAlignment.Center,TextYAlignment=Enum.TextYAlignment.Center,AutoButtonColor=true,Modal=false,Selected=false,Style=Enum.ButtonStyle.Custom,Active=true,AnchorPoint=Vector2.new(0, 0),BackgroundColor3=Color3.new(0.639216, 0.635294, 0.647059),BackgroundTransparency=0,BorderColor3=Color3.new(0.105882, 0.164706, 0.207843),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0, 0, 0, 0),Rotation=0,Selectable=true,Size=UDim2.new(0, 0, 0, 0),SizeConstraint=Enum.SizeConstraint.RelativeXY,Visible=false,ZIndex=1,Name='TextButton',Parent = Junk_var})
local TextButton_var = Deserialize('TextButton',{Font=Enum.Font.Legacy,FontSize=Enum.FontSize.Size8,Text='Button',TextColor3=Color3.new(0.105882, 0.164706, 0.207843),TextScaled=false,TextSize=8,TextStrokeColor3=Color3.new(0, 0, 0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=Enum.TextXAlignment.Center,TextYAlignment=Enum.TextYAlignment.Center,AutoButtonColor=true,Modal=false,Selected=false,Style=Enum.ButtonStyle.Custom,Active=true,AnchorPoint=Vector2.new(0, 0),BackgroundColor3=Color3.new(0.639216, 0.635294, 0.647059),BackgroundTransparency=0,BorderColor3=Color3.new(0.105882, 0.164706, 0.207843),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0, 0, 0, 0),Rotation=0,Selectable=true,Size=UDim2.new(0, 0, 0, 0),SizeConstraint=Enum.SizeConstraint.RelativeXY,Visible=false,ZIndex=1,Name='TextButton',Parent = Junk_var})
local TextButton_var = Deserialize('TextButton',{Font=Enum.Font.Legacy,FontSize=Enum.FontSize.Size8,Text='Button',TextColor3=Color3.new(0.105882, 0.164706, 0.207843),TextScaled=false,TextSize=8,TextStrokeColor3=Color3.new(0, 0, 0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=Enum.TextXAlignment.Center,TextYAlignment=Enum.TextYAlignment.Center,AutoButtonColor=true,Modal=false,Selected=false,Style=Enum.ButtonStyle.Custom,Active=true,AnchorPoint=Vector2.new(0, 0),BackgroundColor3=Color3.new(0.639216, 0.635294, 0.647059),BackgroundTransparency=0,BorderColor3=Color3.new(0.105882, 0.164706, 0.207843),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0, 0, 0, 0),Rotation=0,Selectable=true,Size=UDim2.new(0, 0, 0, 0),SizeConstraint=Enum.SizeConstraint.RelativeXY,Visible=false,ZIndex=1,Name='TextButton',Parent = Junk_var})
local TextButton_var = Deserialize('TextButton',{Font=Enum.Font.Legacy,FontSize=Enum.FontSize.Size8,Text='Button',TextColor3=Color3.new(0.105882, 0.164706, 0.207843),TextScaled=false,TextSize=8,TextStrokeColor3=Color3.new(0, 0, 0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=Enum.TextXAlignment.Center,TextYAlignment=Enum.TextYAlignment.Center,AutoButtonColor=true,Modal=false,Selected=false,Style=Enum.ButtonStyle.Custom,Active=true,AnchorPoint=Vector2.new(0, 0),BackgroundColor3=Color3.new(0.639216, 0.635294, 0.647059),BackgroundTransparency=0,BorderColor3=Color3.new(0.105882, 0.164706, 0.207843),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0, 0, 0, 0),Rotation=0,Selectable=true,Size=UDim2.new(0, 0, 0, 0),SizeConstraint=Enum.SizeConstraint.RelativeXY,Visible=false,ZIndex=1,Name='TextButton',Parent = Junk_var})
local TextButton_var = Deserialize('TextButton',{Font=Enum.Font.Legacy,FontSize=Enum.FontSize.Size8,Text='Button',TextColor3=Color3.new(0.105882, 0.164706, 0.207843),TextScaled=false,TextSize=8,TextStrokeColor3=Color3.new(0, 0, 0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=Enum.TextXAlignment.Center,TextYAlignment=Enum.TextYAlignment.Center,AutoButtonColor=true,Modal=false,Selected=false,Style=Enum.ButtonStyle.Custom,Active=true,AnchorPoint=Vector2.new(0, 0),BackgroundColor3=Color3.new(0.639216, 0.635294, 0.647059),BackgroundTransparency=0,BorderColor3=Color3.new(0.105882, 0.164706, 0.207843),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0, 0, 0, 0),Rotation=0,Selectable=true,Size=UDim2.new(0, 0, 0, 0),SizeConstraint=Enum.SizeConstraint.RelativeXY,Visible=false,ZIndex=1,Name='TextButton',Parent = Junk_var})
local TextButton_var = Deserialize('TextButton',{Font=Enum.Font.Legacy,FontSize=Enum.FontSize.Size8,Text='Button',TextColor3=Color3.new(0.105882, 0.164706, 0.207843),TextScaled=false,TextSize=8,TextStrokeColor3=Color3.new(0, 0, 0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=Enum.TextXAlignment.Center,TextYAlignment=Enum.TextYAlignment.Center,AutoButtonColor=true,Modal=false,Selected=false,Style=Enum.ButtonStyle.Custom,Active=true,AnchorPoint=Vector2.new(0, 0),BackgroundColor3=Color3.new(0.639216, 0.635294, 0.647059),BackgroundTransparency=0,BorderColor3=Color3.new(0.105882, 0.164706, 0.207843),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0, 0, 0, 0),Rotation=0,Selectable=true,Size=UDim2.new(0, 0, 0, 0),SizeConstraint=Enum.SizeConstraint.RelativeXY,Visible=false,ZIndex=1,Name='TextButton',Parent = Junk_var})
local TextButton_var = Deserialize('TextButton',{Font=Enum.Font.Legacy,FontSize=Enum.FontSize.Size8,Text='Button',TextColor3=Color3.new(0.105882, 0.164706, 0.207843),TextScaled=false,TextSize=8,TextStrokeColor3=Color3.new(0, 0, 0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=Enum.TextXAlignment.Center,TextYAlignment=Enum.TextYAlignment.Center,AutoButtonColor=true,Modal=false,Selected=false,Style=Enum.ButtonStyle.Custom,Active=true,AnchorPoint=Vector2.new(0, 0),BackgroundColor3=Color3.new(0.639216, 0.635294, 0.647059),BackgroundTransparency=0,BorderColor3=Color3.new(0.105882, 0.164706, 0.207843),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0, 0, 0, 0),Rotation=0,Selectable=true,Size=UDim2.new(0, 0, 0, 0),SizeConstraint=Enum.SizeConstraint.RelativeXY,Visible=false,ZIndex=1,Name='TextButton',Parent = Junk_var})
local TextButton_var = Deserialize('TextButton',{Font=Enum.Font.Legacy,FontSize=Enum.FontSize.Size8,Text='Button',TextColor3=Color3.new(0.105882, 0.164706, 0.207843),TextScaled=false,TextSize=8,TextStrokeColor3=Color3.new(0, 0, 0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=Enum.TextXAlignment.Center,TextYAlignment=Enum.TextYAlignment.Center,AutoButtonColor=true,Modal=false,Selected=false,Style=Enum.ButtonStyle.Custom,Active=true,AnchorPoint=Vector2.new(0, 0),BackgroundColor3=Color3.new(0.639216, 0.635294, 0.647059),BackgroundTransparency=0,BorderColor3=Color3.new(0.105882, 0.164706, 0.207843),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0, 0, 0, 0),Rotation=0,Selectable=true,Size=UDim2.new(0, 0, 0, 0),SizeConstraint=Enum.SizeConstraint.RelativeXY,Visible=false,ZIndex=1,Name='TextButton',Parent = Junk_var})
local TextButton_var = Deserialize('TextButton',{Font=Enum.Font.Legacy,FontSize=Enum.FontSize.Size8,Text='Button',TextColor3=Color3.new(0.105882, 0.164706, 0.207843),TextScaled=false,TextSize=8,TextStrokeColor3=Color3.new(0, 0, 0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=Enum.TextXAlignment.Center,TextYAlignment=Enum.TextYAlignment.Center,AutoButtonColor=true,Modal=false,Selected=false,Style=Enum.ButtonStyle.Custom,Active=true,AnchorPoint=Vector2.new(0, 0),BackgroundColor3=Color3.new(0.639216, 0.635294, 0.647059),BackgroundTransparency=0,BorderColor3=Color3.new(0.105882, 0.164706, 0.207843),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0, 0, 0, 0),Rotation=0,Selectable=true,Size=UDim2.new(0, 0, 0, 0),SizeConstraint=Enum.SizeConstraint.RelativeXY,Visible=false,ZIndex=1,Name='TextButton',Parent = Junk_var})

This happened:

image

So I took a look inside LuaY:

------------------------------------------------------------------------
-- prepares error message for display, for limits exceeded
-- * used only in checklimit()
------------------------------------------------------------------------
function luaY:errorlimit(fs, limit, what)
  local msg = (fs.f.linedefined == 0) and
    string.format("main function has more than %d %s", limit, what) or
    string.format("function at line %d has more than %d %s", --<---------------- this is LuaY:303
                  fs.f.linedefined, limit, what)
  luaX:lexerror(fs.ls, msg, 0)
end

I printed fs.f and found that fs.f.linedefined is nil, but fs.f.lineDefined exists (capital D). If you replace all occurrences of linedefined with the camel case variant, you get the proper error for the script:

image

I think this qualifies as a bug because I spent a lot of time trying to figure out why I was getting a string.format error when my code never even used that function. The error being shown by Adonis is not helpful enough to determine what's wrong.

Device

MAC

Relevant log output

[14:48:31] (x4) [:ss] Loader.MainModule.Server.Commands.Admins:921: Script unable to be created: Loadstring.LuaY:303: invalid argument #2 to 'format' (number expected, got nil)

--- Loadstring Stacktrace Begin --- 

Loadstring.LuaY:303 function errorlimit
Loadstring.LuaY:258 function checklimit
Loadstring.LuaY:424 function new_localvar
Loadstring.LuaY:1639 function localstat
Loadstring.LuaY:1770 function statement
Loadstring.LuaY:1799 function chunk
Loadstring.LuaY:704 function parser
Loadstring:106
Loadstring:104
Loader.MainModule.Server.Core.Core:594 function Bytecode
Loader.MainModule.Server.Commands.Admins:920 function Function
Loader.MainModule.Server.Shared.Service:124 function taskFunc
Loader.MainModule.Server.Shared.Service:140 function TrackTask
Loader.MainModule.Server.Core.Process:555 function Command
Loader.MainModule.Server.Core.Remote:960 function ProcessCommand
Loader.MainModule.Server.Shared.Service:124 function taskFunc
Loader.MainModule.Server.Shared.Service:140 function TrackTask
Loader.MainModule.Server.Core.Process:366 function Remote
Loader.MainModule.Server.Core.Core:264

--- Loadstring Stacktrace End ---
@Mars7383 Mars7383 added the 🐛 bug Bugs or broken features label Aug 16, 2024
@github-actions github-actions bot added the 🎏 miscellaneous Miscellaneous content label Aug 16, 2024
@wilsontulus
Copy link
Contributor

If you replace all occurrences of linedefined with the camel case variant, you get the proper error for the script:

I think it's the time you should make a whole PR and earn your contributor role here.

@EasternBloxxer
Copy link
Contributor

ur a typo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Bugs or broken features 🎏 miscellaneous Miscellaneous content
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants