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

whats wrong with this script ? [closed]

Asked by 9 years ago

output:20:08:16.118 - Workspace.Script:24: attempt to index a nil value 20:08:16.118 - Stack Begin 20:08:16.119 - Script 'Workspace.Script', Line 24 20:08:16.120 - Stack End

function setMessageVisibility(objects, visible)
    for _, object in pairs(objects) do
        object.Visible = visible
    end
end

game.Players.PlayerAdded:connect(function(player)   
local pack = Instance.new("Model",game.Lighting)

local holder = game.Lighting.holder
holder:clone().Parent = pack

local clothes = game.Lighting.clothes
clothes:clone().Parent = pack

local faces = game.Lighting.faces
faces:clone().Parent = pack

local inventory = game.Lighting.inventory
inventory:clone().Parent = pack
pack.Name = player.Name.."sPack"
script.Parent.check.Value = 0
if player.Name == "Player" then
game.ServerStorage:findFirstChild(game.ServerStorage.GM, true):GetChildren():Clone().Parent = game.Lighting.player.Name.."sPack"..inventory
    end
end)
0
Your question is too vague; What is wrong? Was there any Output? Is this the whole script? What isn't working about it? Because, looking at it, this IS NOT the entire script, but, however, I am seeing ALLOT of errors in this small chunk of code. TheeDeathCaster 2368 — 9y

Locked by BlueTaslem

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
1
Answered by 9 years ago

Well to start, your first argument for FindFirstChild is incorrect. You already told it to look for this in ServerStorage so telling it again actually is telling it to find game.ServerStorage.game.ServerStorage (which doesn't exist) Also, try simplifying this script. EXAMPLE

if player.Name == "Player" then
Argue = game.ServerStorage:FindFirstChild("GM") --I have no clue what the "true" is for, please let me know if I need it.
Children = Argue:GetChildren()
Thing = Children:Clone()
Thing.Parent = game.Lighting.player.Name --IDK what you did, but including [.."sPack"..] is also going to break this.

A lot of things in your script are inefficient and incorrect. My answer probably won't fix the script, but it will get you closer. When you finish fixing what I have given you, please edit your question for further review.

If I helped, please accept my answer

If there are any bugs, let me know and I will correct them if I can

THANKS!

Ad