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?(why do I need a question mark?) FIXED discord = 10/10

Asked by 6 years ago
Edited 6 years ago

Problem = Players.Viktor_Void.PlayerGui.mainScreen.statFrame.statBar:5: attempt to index a nil value code with problem =

Player = script.Parent.Parent.Parent.Parent RS = game:GetService("ReplicatedStorage")

while wait() do script.Parent.strengthBar.Text = "Strength "..RS.statsFolder:FindFirstChild("Player.Name").Strength.Value script.Parent.perceptionBar.Text = "Perception "..RS.statsFolder:FindFirstChild("player.Name").Perception.Value script.Parent.enduranceBar.Text = "Endurance "..RS.statsFolder:FindFirstChild("player.Name").Endurance.Value script.Parent.wisdomBar.Text = "Wisdom "..RS.statsFolder:FindFirstChild("player.Name").Wisdom.Value script.Parent.agileBar.Text = "Agile "..RS.statsFolder:FindFirstChild("player.Name").Agile.Value script.Parent.fortuitousBar.Text = "Fortuitous "..RS.statsFolder:FindFirstChild("player.Name").Fortuitous.Value end

Code linked with problem question mark =

statsfolder = game.ReplicatedStorage:WaitForChild("statsFolder")

game.Players.PlayerAdded:connect(function(Player) local statData = Instance.new("Folder",statsfolder) statData.Name = Player.Name

local Strength = Instance.new("IntValue",statData)
Strength.Name = "Strength"
Strength.Value = 1

local Perception = Instance.new("IntValue",statData)
Perception.Name = "Perception"
Perception.Value = 1

local Endurance = Instance.new("IntValue",statData)
Endurance.Name = "Endurance"
Endurance.Value = 1

local Wisdom = Instance.new("IntValue",statData)
Wisdom.Name = "Wisdom"
Wisdom.Value = 1

local Agile = Instance.new("IntValue",statData)
Agile.Name = "Agile"
Agile.Value = 1

local Fortuitous = Instance.new("IntValue",statData)
Fortuitous.Name = "Fortuitous"
Fortuitous.Value = 1

end)

what I'm I doing wrong here

0
The first thing that you did wrong is that you did not put all the code inside codeblock. Fix that then someone will take a look at your question. Zafirua 1348 — 6y
0
thank was talking to someone on discord, and thank you Viktor_Void 0 — 6y

Answer this question