#Values is not member of player
1 messages · Page 1 of 1 (latest)
local ServerScriptService = game:GetService("ServerScriptService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local ProfileService = require(ServerScriptService.Modules.ProfileService)
local ProfileTemplate = require(script.ProfileTemplate)
local ProfileStore = ProfileService.GetProfileStore(
"Test key",
ProfileTemplate
)
local module = {}
module.Profiles = {}
local function loadPlayerInstances (Player, Profile)
for _, v in script.PlayerValues:GetChildren() do
v:Clone().Parent = Player
end
task.spawn(function()
while true do
for _,v in Players.leaderstats:GetChildren() do
local ActualValue = Profile.Data.leaderstats[v.Name]
v.Value = ActualValue
end
task.wait(0.1)
end
end)
end
local function PlayerAdded(Player)
local Profile = ProfileStore:LoadProfileAsync("Player_" .. Player.UserId)
if Profile then
Profile:AddUserId(Player.UserId)
Profile:Reconcile()
Profile: ListenToRelease(function()
module.Profiles[Players]=nil
Player:Kick()
end)
if Players:IsDescendantOf(Players) ==true then
module.Profiles[Player] = Profile
loadPlayerInstances(Player, Profile)
else
Profile:Release()
end
else
Player:Kick()
end
end
for _, Player in Players:GetPlayers() do
task.spawn(PlayerAdded, Player)
end
Players.PlayerAdded:Connect(PlayerAdded)
Players.PlayerRemoving:Connect(function(Player)
local Profile = module.Profiles[Player]
if Profile then
Profile:Release()
end
end)
return module
the data save script
this is my ProfileTempates
return {
["leaderstats"] = {
Kills = 0
}
}
local function loadPlayerInstances (Player, Profile)
for , v in script.PlayerValues:GetChildren() do
v:Clone().Parent = Player
end
task.spawn(function()
while true do
for ,v in Players.leaderstats:GetChildren() do
local ActualValue = Profile.Data.leaderstats[v.Name]
v.Value = ActualValue
end
task.wait(0.1)
end
end)
end
you used Players as in the GetService("Players") instead of your variable Player that you passed in the function
@peak idol
oh
** You are now Level 1! **
ty i fixed it but i still get the error
i still get the error is there any other ways
never did a for loop where i didnt have something for the index
for your for loop what did you use for the first variable?
for variable1, variable2 in thing
whats your variable1
i dont even know what variable mean i didnt script this by myself
could you take a screen shot of the loadPlayerInstances function
** You are now Level 7! **
i.. i dont know
are you updating the leaderstats every 0.1s...
yea
im going to ignore that but do look into changing that because that will obliterate the server
so what do u think i should put
well not obliterate but it will take more power than it needs
i would put something that detects when that value gets changed then update the leaderboard
is everything from the leaderstats:getchilren a stringvalue or something like that
stringvalue, numvalue, boolean kinda thing
oh its in the screenshot
this is the only thing right?
oh wait i think i see it
local ActualValue = Profile.Data.leaderstats[v.Name].Value
what wrong with it
** You are now Level 2! **
uh how to explain lets see
ye?
local ActualValue = Profile.Data.leaderstats[v.Name]
is like you gave someone that backpack and
v.Value = ActualValue
is like telling someone to grab your pencil from that backpack
the person doesnt know which part of the backpack the pencil is
local ActualValue = Profile.Data.leaderstats[v.Name].Value
is like saying the pencil is in this specific pocket of that backpack
anyways just try replacing adding a ".Value" at the end of that line
or you could do
v.Value = ActualValue.Value
same thing
same error?
could you screen shot it
the error in the console said it came from line 24 of profileManager?
thats why i wanted a screenshot of the error :/
uh
above that line
can you add print(Player:GetChildren())
im assuming thats a normal player
and actually judging by how you said you joined and got kicked immediately
it might be because the values folder wasnt created yet
no
oh above?
ClickAttackDebounces[Player] = true
print(Player:GetChildren())
local punchcombo
its most likely going to output a giant list of garbage
but lets see first
well that answers it
i cant see it
hold on
Local PunchCombo = Player.character.Values.PunchCombo
im gonna guess thats where your folder is put
@peak idol
do u mean i should add character
yea
add character inbetween Player and Values
you can just copy paste what i typed though
** You are now Level 3! **
error line 29
everything was good untill i got the profileService from toolbox and i script the profileManger and profiletemplate and serverruntime
ok lets go back a bit
what exactly is "Values" supposed to be
and where is it being created
because i assumed it was a folder that was placed in the character of a player
at serverScriptService and its for the punching combat
im just following video of someone
it wasnt at profilemanger but the video said put it there
it was at script called datahandler
can you show me where in the code the "values" folder is being created
im looking for something like folder.parent = something
you probably wont be able to fix anything, or understand any of the help offered, if you don't first understand the basics such as what is a variable. this series explains all the basics you will need https://create.roblox.com/docs/tutorials/fundamentals/coding-1/coding-fundamentals
what is that
was that u
when copying from a video without understanding, you may as well use chatgpt, you'll get the same (extremely poor) results, and you probably copied the video wrong.
apparently it's easy to mess up copy+pasting 
but i cant script
exactly, so start with the basics
this will teach you the basics of scripting
so then you will be able to script
or i mean, if you don't care to learn you can always pay someone to do it for you
or pray others don't lose patience 
how long it takes to learn scripting
Years
depends really
basics takes a few weeks. mastery takes years
but yea it will definitely take a while
i would do like an episode of a tutorial a day for like 3 months before starting my own projects
depends on the job, you seemingly want some simple changes but i no doubt this will evolve into "okay now that x is fixed can you now do y for me which is what i was trying to do from the start?" and it escalates from there
and then you try to add things to the job that weren't there from the start
honestly easier to just learn the basics so you dont do that
it's kinda like software firm hr managers, who know nothing about development, firing their developers because they think chatgpt can do it better, faster, cheaper, despite not knowing the first thing about development
chagpt never helped me
hilarity ensues, so make sure you understand what you're asking for before you ask for it will go a long way 👍
but the basic cant help me
woah pyro when did u get script ranker
i get the impression you're very young, a few weeks to learn some basic scripting skills is not going to hurt you
if i know how to script how can i understand where to put these scripts
*if you know how to script, how will you know how to script?
fixed
well that's easy. when you know how to script, you will know how to script 
i cant work on any of my projects at the moment so i figured why not for a bit
congrats bro
thats like a huge achievement
ehhh not really
and s3 as well 🎊
i was offered way back but didnt take it coz its just responsibility
and commitment, its just work
pyro how did u learned scripting
i know, it doesn't look like that from the outside but it is ;p
rankers get more respect from what i see at least so thats an upside 🤷
but yeah with power comes responsibility
i've been scripting for years, i knew enough from other languages and work to not need to study https://create.roblox.com/docs/tutorials/fundamentals/coding-1/coding-fundamentals because i already knew it. since i already knew unity i just used the quickstart and have been practicing since https://create.roblox.com/docs/unity i read lots of documentation, as any good scripter does.
yas i learned a fair bit of unity
i also spent like a year writing my own c++ game engine from scratch before it occurred to me that it is way, way too much work on my own, even unity is too much
so roblox it is
same
wow i never knew
in fact when i first came here i thought nobody knew about unity and that i would just be the odd one out
c++ is crazy work its really tough
most high level developers have used other engines and know many other languages
they're around
it's just... they're mixed in with roblox kids who think its easy to make games, then when they go to try they hit a brick wall of difficulty and give up. that's the divide you're seeing ;o
yup
not to mention those who do get past the wall
well they make a game
and they publish it
and it become buried
within the mass of brainrot
that is circulating the platform
kind-of like this friendly chap. inspired by roblox, just starting out, at the first sign of having to put in work almost immediately give up. nothing in life comes without effort, there are no shortcuts ;o
i was like that a few weeks ago too
turns out being lazy/using shortcuts just makes things harder
but i didnt give up i worked on this project for 1 month
thats very good
ur determined
so don't give up now 🙂
determination is a virtue. it's a long road but it is worth it if you stick it out. same goes for any other skill really. you won't get anywhere with development if you completely ignore the basics of scripting, all the same you will want to learn the basics of building, modelling, and working with sounds if you really want to make a full game. you don't need to be an expert, but the basics will do you huuuge favors
it may seem hard now but hey it'll be worth it once your game get thousands of active and uhhh monetization or smth
you might say, if you're trying to learn how to swim for the first time, sailing out to the middle of the ocean and diving off a boat is a really bad idea.
start in the kiddie pool first before you even get to jumping in the deep end of an indoor pool https://create.roblox.com/docs/tutorials/fundamentals/coding-1/coding-fundamentals
not to mention once you're out of roblox, you'll probably already have learnt a huge percentage of scripting, because all language are similar in some way (etc C# has void as to Roblox Lua's function)
Though function is also used in many other languages with similar/same functionality
im seeing the sites now ( english is not even my language ) and im struggling at some words but i still want to learn the basics so dont compare me with those lazy kids👀
and just as a side note, combat games are very difficult to make, you gonna have a very bad time if this is your first ever game. i suggest making simpler things first, like start with +1 jump/sec. if you can't manage that, you sure wont be able to manage a combat game.
this is why i tried to take the easy way but it wasnt like i thought
i believe u can do it 👍
in fact my first game was +1jump/sec just because it's an easy way to get a feel for working with roblox
lowkey my first game i ever scripted at all in was a combat game (i gave up on it tho)
then i did a button simulator, and a monster-in-a-maze, my latest was a full simulator/tycoon thing, my next one is maybe a pve combat game
all code cooked up by myself personally, no copy+pasting, no tutorials, no ai
just sheer skill.
the point is make smaller practice games just for experience first, don't start with your dream game
and if the game is bad, no problem! you got what you needed out of it, your next game is always better.