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

Value is not a valid member of BoolValue?

Asked by
rymer9 0
5 years ago
Edited 5 years ago

I don't know what I am doing wrong but in the output it says "value is not a valid member of BoolValue" in red. The problem is somewhere in here but I can't figure it out.

local serverStorage = game:GetService("ServerStorage")



game.Players.PlayerAdded:Connect(function(player)


local leaderstats = Instance.new("Folder")

leaderstats.Name = "leaderstats"

leaderstats.Parent = player


local strength = Instance.new("NumberValue")

strength.Name = "Strength"

strength.Parent = leaderstats


local rebirths = Instance.new("IntValue")

rebirths.Name = "Rebirths"

rebirths.Parent = leaderstats


local dataFolder = Instance.new("Folder")

dataFolder.Name = player.Name

dataFolder.Parent = serverStorage.RemoteData


local debounce = Instance.new("BoolValue")

debounce.Name = "Debounce"

debounce.Parent = dataFolder

end)
0
Can you please post the full script. There is no value checking in this so its not this script. BenjySmb 16 — 5y
0
The error isn't even related to the question. SuperSamyGamer 316 — 5y
0
.Value is case sensitive AnonymousDeveloper13 22 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.

Are you trying to make a leaderstat that saves if so then use this `local DSService2 = game:GetService('DataStoreService'):GetDataStore('StrengthSaveSystem')

local DSService1 = game:GetService('DataStoreService'):GetDataStore('RebirthSaveSystem')

game.Players.PlayerAdded:Connect(function(plr)

-- Define variables

local uniquekey = 'id-'..plr.userId

local leaderstats = Instance.new('IntValue', plr)

leaderstats.Name = 'leaderstats'

local fakestats = Instance.new('Folder', plr)

fakestats.Name = 'fakestats'

local savevalue2 = Instance.new('IntValue')

savevalue2.Parent = leaderstats

savevalue2.Name = "Strength"

local savevalue3 = Instance.new('IntValue')

savevalue3.Parent = leaderstats

savevalue3.Name = "Rebirths"

-- GetAsync

local GetSaved = DSService1:GetAsync(uniquekey)

if GetSaved then

savevalue2.Value = GetSaved[1]

savevalue3.Value = GetSaved[2]

else

local NumbersForSaving = {savevalue2.Value, savevalue3.Value}

DSService1:SetAsync(uniquekey, NumbersForSaving)

end

end)

game.Players.PlayerRemoving:Connect(function(plr)

local uniquekey = 'id-'..plr.userId

local Savetable1 = {plr.leaderstats["Strength"].Value, plr.leaderstats["Rebirths"].Value}

DSService1:SetAsync(uniquekey, Savetable1)

end)`

Ad

Answer this question