Hello, I am making an inventory system and I am trying to make a script in a script so this is what I am trying to do:
-- lets start...
-- the frame holds 25 imagebuttons
function MakeFrames()
local HowManyFrames = 10
local b = 0
repeat
local addValue = UDim2.new(b,0,0,0)
local il = Instance.new("ImageButton", script.Parent)
il.Size = UDim2.new(0.04, 0,0.845, 0)
il.Position = UDim2.new(0,0,0,0) + addValue
b = b + 0.04
HowManyFrames = HowManyFrames - 1
local NEWSCRIPT = Instance.new("Script", il)
NEWSCRIPT.script = "print(b.Value)"
until HowManyFrames == 0
-- replicated
end
MakeFrames()
The error is on line 13 and 14 , script is not a valid member of script, what can I do?

4 comments
Correct me if I am wrong but you named the new script "NEWSCRIPT", and not script? So you'd call it using 'il.NEWSCRIPT' and not "il.script"
Still, I don't exactly understand why you've made your system like this? Care to explain?
You cannot set a source of a script, without command bar permissions or plugin permissions.
So wait, I fixed what T0XN said... The script is to create imagebuttons in a frame and insert a whole new script with a code i want in it, I will have to code the code but I am trying to figure out a way to do that...