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

ServerScriptService.Givestand:37: attempt to index nil with 'clone'?

Asked by 4 years ago
Edited 4 years ago

local Stands = {

[1] = "Noobs"; [2] = "RockRoller"; [3] = "Reaper"; [4] = "Noobs2"; [5] = "Noobs3"; [6] = "Garbage"; [7] = "Holo"; [8] = "Steve"; [9] = "Glass"; [10] = "ShadowGlass"; [11] = "NoobsUnderHell"; [12] = "RockRollerOH"; [13] = "Pumpkin"; [14] = "Positive"; [15] = "Snow"; [16] = "Klown"; [17] = "Crystal"; [18] = "Gun"; [19] = "purple"; [20] = "koolaid"; [21] = "dj"; }

game:GetService("ReplicatedStorage").give.OnServerEvent:Connect(function(player, parent) local chr = player.Character local data = player:WaitForChild("Data") local data2 = data:WaitForChild("Stand")

for ind, val in pairs(Stands) do
    if data2.Value == ind then
        wait(0.3)
        local thing = game.Lighting:FindFirstChild(val):Clone()
        thing.Parent = parent
    end
end

end)

0
The argument should be val.Name, not just val. Rinpix 639 — 4y

Answer this question