#Values is not member of player

1 messages · Page 1 of 1 (latest)

peak idol
#

help

#

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

#

star_fill this is my ProfileTempates
return {
["leaderstats"] = {
Kills = 0
}
}

plush salmon
#

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

peak idol
#

oh

dark coralBOT
#

studio** You are now Level 1! **studio

peak idol
#

ty i fixed it but i still get the error

plush salmon
#

just making sure

#

actually

#

let me see if that works

peak idol
#

i still get the error is there any other ways

plush salmon
#

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

peak idol
#

i dont even know what variable mean i didnt script this by myself

plush salmon
#

uhhh

#

well...

peak idol
#

bro i need to fix this

#

i was working for 1 month

plush salmon
#

could you take a screen shot of the loadPlayerInstances function

dark coralBOT
#

studio** You are now Level 7! **studio

peak idol
#

sure

plush salmon
#

wait i didnt even see that

#

why is there a
while true do

peak idol
#

i.. i dont know

plush salmon
#

are you updating the leaderstats every 0.1s...

peak idol
#

yea

plush salmon
#

im going to ignore that but do look into changing that because that will obliterate the server

peak idol
#

so what do u think i should put

plush salmon
#

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?

peak idol
#

ye'

#

i just wanna count people kills

plush salmon
#

oh wait i think i see it

#

local ActualValue = Profile.Data.leaderstats[v.Name].Value

peak idol
#

what wrong with it

dark coralBOT
#

studio** You are now Level 2! **studio

plush salmon
#

uh how to explain lets see

plush salmon
#

ok so

#

imagine you have a backpack with the name "V"

peak idol
#

ye?

plush salmon
#

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

peak idol
#

ye i understand the explanation already and i did put the value

#

it didnt work

plush salmon
#

same error?

peak idol
#

ye

#

same

plush salmon
#

could you screen shot it

peak idol
#

dw its the same

#

everytime i join i get kicked out

plush salmon
#

the error in the console said it came from line 24 of profileManager?

peak idol
#

no line 28

#

wait

#

and its not even from profileService

plush salmon
#

thats why i wanted a screenshot of the error :/

peak idol
#

its from my attackhandler

plush salmon
#

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

peak idol
#

like this

plush salmon
#

no

peak idol
#

oh above?

plush salmon
#

ClickAttackDebounces[Player] = true
print(Player:GetChildren())
local punchcombo

#

its most likely going to output a giant list of garbage

#

but lets see first

peak idol
#

error at 29

plush salmon
#

can you click that

#

the arrow

#

or the {...} next to it

peak idol
plush salmon
#

well that answers it

peak idol
#

i cant see it

plush salmon
#

hold on

#

Local PunchCombo = Player.character.Values.PunchCombo
im gonna guess thats where your folder is put

#

@peak idol

peak idol
#

wym

#

which folder

peak idol
plush salmon
#

yea

plush salmon
#

you can just copy paste what i typed though

peak idol
dark coralBOT
#

studio** You are now Level 3! **studio

peak idol
#

error line 29

#

everything was good untill i got the profileService from toolbox and i script the profileManger and profiletemplate and serverruntime

plush salmon
#

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

peak idol
#

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

plush salmon
#

can you show me where in the code the "values" folder is being created

#

im looking for something like folder.parent = something

peak idol
#

not script i mean moduelscript

nova pike
nova pike
#

apparently it's easy to mess up copy+pasting hehe

peak idol
#

but i cant script

nova pike
nova pike
#

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

nova pike
peak idol
#

how long it takes to learn scripting

ember wadi
plush salmon
#

depends really

nova pike
plush salmon
#

but yea it will definitely take a while

peak idol
#

how much scriptier takes for doing that

#

money

plush salmon
#

i would do like an episode of a tutorial a day for like 3 months before starting my own projects

nova pike
#

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

peak idol
#

chagpt never helped me

nova pike
#

hilarity ensues, so make sure you understand what you're asking for before you ask for it will go a long way 👍

peak idol
#

but the basic cant help me

sharp hazel
#

woah pyro when did u get script ranker

nova pike
peak idol
#

if i know how to script how can i understand where to put these scripts

nova pike
#

well that's easy. when you know how to script, you will know how to script Thumbs

nova pike
sharp hazel
#

thats like a huge achievement

nova pike
#

ehhh not really

sharp hazel
#

and s3 as well 🎊

nova pike
#

i was offered way back but didnt take it coz its just responsibility

#

and commitment, its just work

sharp hazel
#

true

#

but like

#

uh

#

you could say its some form of flexing...?

#

idk tho

peak idol
#

pyro how did u learned scripting

nova pike
#

i know, it doesn't look like that from the outside but it is ;p

sharp hazel
#

rankers get more respect from what i see at least so thats an upside 🤷

#

but yeah with power comes responsibility

nova pike
# peak idol pyro how did u learned scripting

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.

Teaches the basics of coding with Luau.

If you're an experienced Unity developer, use this page to get oriented with Roblox.

sharp hazel
#

wait pyro

#

you used to use unity as well?

#

hey i never knew

#

same

nova pike
#

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

sharp hazel
sharp hazel
nova pike
#

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

sharp hazel
#

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

nova pike
# peak idol pyro how did u learned scripting

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

sharp hazel
#

i was like that a few weeks ago too
turns out being lazy/using shortcuts just makes things harder

peak idol
#

but i didnt give up i worked on this project for 1 month

sharp hazel
#

ur determined

#

so don't give up now 🙂

nova pike
# peak idol but i didnt give up i worked on this project for 1 month

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

sharp hazel
nova pike
#

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.

sharp hazel
#

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

peak idol
#

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👀

nova pike
# peak idol here

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.

peak idol
nova pike
#

in fact my first game was +1jump/sec just because it's an easy way to get a feel for working with roblox

sharp hazel
nova pike
#

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.