#why i dont always get my stat increased when i get the coin
98 messages · Page 1 of 1 (latest)
local coin = script.Parent
coin.Touched:Connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value +1
end
coin:Destroy()
end)
im new so im not aware of this
enable console
idk shit about datastores but anyways
just make sure the coin destroys only when it finds a player
as invalid argument 2
it dont do an error
it does but dont get stats increased
is it script or a local
what is wrong in code?
rn it destroys no matter what touched it
in player reving u doing get async, u should be saving so saveasync
or whatever it is called
alright thanks
mmh alright
also about the coin script, what type of script it is
and any errorS?
NO ERROR
caps sorry
do u have output on?
also i dont get why stats aint saving, should i replace getasync with save
yes
yea
saveasync or whatever it was
im following a tuto and the guy use the same script for him it saves
to save
show me ss
alright imma try
in here
every thing works except:
-1/2 times the stat dont increase by one as supposed
- the stats aint saving
move the coin:Destroy() into if player then
so it only gets deleted
when
it finds the player
its still not saving?
how did u check
not saving
i test end test and test again
whenever i get one coin it gets back to 0
do u ever increase the stat tho
i feel like it fixed my first proble
m
yes
it didnt in the rec because i wanted to show you sometimes it didnt
** You are now Level 3! **
ye idfk bro
i get +1
nw thanks for the help
u fixed one
@urban pecan
okey i fixed it
sorry for bothering u for nothing
huh.?
where
ss
it shouldnt change anything
u can call it whatever
unless u using it somewhere too
idk but it did work
i aint
your issues seem to be fixed by absolutely things that dont matter
sus but ok
if it works it works