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

ServerScriptService.Game Logic.RoundModule:32: attempt to index nil with 'Name' ?

Asked by 4 years ago
01local module = {}
02 
03local status = game.ReplicatedStorage:WaitForChild("Status")
04 
05function module.Intermission(length)
06    for i = length,0,-1 do
07        status.Value = "Next round starts in "..i.." seconds"
08        wait(1)
09    end
10end
11 
12function module.SelectChapter()
13    local rand = Random.new()
14    local chapters = game.ReplicatedStorage.Chapters:GetChildren() -- Table of all map models
15    local chosenChapter = chapters[rand:NextInteger(1,#chapters)]
View all 39 lines...

and it says that character.Name = Piggy.Name is the problem

0
Tell us what you're passing through when you're calling the "DressPiggy" method. Or else we can't do anything. tantec 305 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Try use:

1if value == nil then
2    warn("Error")
3    --script
4end

or

1if value:FindFirstChild("Name") == nil then
2    warn("Error")
3    --script
4end
Ad

Answer this question