I need help with this script

No, like in the Explorer tab, what the children of ServerScriptService are (fully expanded).

x.Value = d:GetAsync(plr.UserId) or v.Value is trying to reference the value of a child of this script. however, there isn’t a value for the child the script finds first.

image

1 Like

Capacity Sytem - Roblox i updated the model

Ok, so replace this with the current GetSaved() function.

function GetSaved(plr)
	for i,v in pairs(script:GetChildren()) do 
        if v:IsA("IntValue") or v:IsA("NumberValue") then
		    local d = DataStore:GetDataStore(v.Name)
		    local x = Instance.new("NumberValue",plr.leaderstats)
		    x.Name = v.Name
		    x.Value = d:GetAsync(plr.UserId) or v.Value
        end
	end
end

This checks to make sure it only finds NumberValue or IntValues, values with numbers.

@RyloRiz @JavaKingz
thank you this has really helped

1 Like

@Official_ProGamerYT did everything work?

You may want to mark a solution so the community knows the problem is resolved.

it isnt working it says in the output “Value is not a valid member of RemoteEvent”

ohh lol i forget about it, now check the model and everthing should work now

the error says “OnServerEvent is not a valid member of ReplicatedStorage”

ahhh lol i forget to type ‘AddPoints’ i am so dumb now yeah i can assume everthing works

thank you javekingz you are a really good programmer

1 Like

thank you RyloRiz you are a really good programmer

Thx, this isn’t actually my main account (@R0bl0x10501050 is) but its currently inaccessible so I’m stuck with an alt lol.

1 Like

oh ok lol I hope you could access it

1 Like

Yea, its just in the morning my main PC isn’t available so I have to use this laptop with my original very first account on it.