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

attempt to index a nil value error fix? [EASY]

Asked by 5 years ago

Hey, I am making speed simulator game. Can someone help me?

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        wait(.5)
        local Humanoid = character:WaitForChild("Humanoid")

        Humanoid.Running:Connect(function(speed)
                local leaderstats = player:FindFirstChild("leaderstats")
                local WalkSpeed = player:FindFirstChild("Confings"):FindFirstChild("WalkSpeed")

                wait(1)
                if speed > 0 then
                leaderstats:WaitForChild("Steps").Value = leaderstats:WaitForChild("Steps").Value +1
                WalkSpeed.Value = WalkSpeed.Value +0.1
            end
        end)
    end)
end)

23:18:49.739 - ServerScriptService.PlayerSettings:38: attempt to index a nil value 23:18:49.740 - Stack Begin 23:18:49.740 - Script 'ServerScriptService.PlayerSettings', Line 38 23:18:49.741 - Stack End

0
Where is line 38? Post full code if you want help. User#19524 175 — 5y
0
its the full coded. FrezeTagger 75 — 5y
0
I think what the other person is trying to say is that he can't find line 38. My guess is that you omitted some lines so we can't say which line is line 38. Or maybe it's referring to another file. Ribasu 127 — 5y
0
If I had to guess which line is 38, I'd say it's either line 9 or 10 here. Can't tell exactly where your problem is, at least type --problem here or --line 38.. LetterSlayer 42 — 5y
0
I'm not going to try guessing.. Give us the full code. seith14 206 — 5y

Answer this question