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

Struggling in many hours and can't figure it out? :(

Asked by
korj5 0
9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
local type = script.Parent.Parent.Name
type = type:sub(#type-1,#type)

if type == "-uc" then
    type = "-c"
end
ID = game:GetService("ServerScriptService").DOL.LicenseSender:Invoke(type)
if type:sub(1,1)==" " then
    type = type:sub(2,2)
end
for _,p in pairs (script.Parent:GetChildren()) do
    if p.Name == "Plate" then
        g = p:FindFirstChild(type)
        p.BrickColor = g.Color.Value
        g.Enabled = true
        g.ID.Text = ID
        for _,i in pairs (p:GetChildren()) do
            if i:IsA("SurfaceGui") and i.Name ~= type then
                i.Enabled = false
            end
        end
    end
end

The Error, 22:25:20.815 - Workspace.Sports Car-PD.Body.License Plates:14: attempt to index global 'g' (a nil value) 22:25:20.817 - Stack Begin 22:25:20.819 - Script 'Workspace.Sports Car-PD.Body.License Plates', Line 14 22:25:20.820 - Stack End

0
What are you trying to accomplish here? What you do you expect `type` to be when you get to line 12? BlueTaslem 18071 — 9y

Answer this question