#why i dont always get my stat increased when i get the coin

98 messages · Page 1 of 1 (latest)

primal sinew
#

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)

urban pecan
#

1 question

#

u realize u

#

doing get async

#

instead of saving

#

in removing

primal sinew
#

im new so im not aware of this

urban pecan
#

enable console

random karma
#

idk shit about datastores but anyways

urban pecan
#

it should error

#

i believe

random karma
#

just make sure the coin destroys only when it finds a player

urban pecan
#

as invalid argument 2

primal sinew
primal sinew
primal sinew
random karma
#

rn it destroys no matter what touched it

urban pecan
#

or whatever it is called

primal sinew
urban pecan
#

also about the coin script, what type of script it is
and any errorS?

primal sinew
#

caps sorry

urban pecan
primal sinew
#

also i dont get why stats aint saving, should i replace getasync with save

primal sinew
urban pecan
#

saveasync or whatever it was

primal sinew
#

im following a tuto and the guy use the same script for him it saves

urban pecan
#

to save

primal sinew
urban pecan
#

that shouldnt be a problem tho

#

can u show me your explorer

primal sinew
primal sinew
urban pecan
#

as u see

#

u using GetAsync

#

in player removing

urban pecan
#

so expand it

primal sinew
#

but it stil dont work tho

primal sinew
primal sinew
urban pecan
#

mm

#

so when u touch it nothing at all happends?

primal sinew
#

every thing works except:
-1/2 times the stat dont increase by one as supposed

  • the stats aint saving
urban pecan
#

move the coin:Destroy() into if player then

#

so it only gets deleted

#

when

#

it finds the player

urban pecan
#

how did u check

primal sinew
primal sinew
#

whenever i get one coin it gets back to 0

urban pecan
primal sinew
#

m

primal sinew
#

it didnt in the rec because i wanted to show you sometimes it didnt

drifting bloomBOT
#

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

urban pecan
#

increase it

#

or

primal sinew
#

no

#

when i get to the coin

urban pecan
#

ye idfk bro

primal sinew
#

i get +1

primal sinew
#

u fixed one

#

@urban pecan

#

okey i fixed it

#

sorry for bothering u for nothing

urban pecan
#

dw

#

and

#

how did u fix

primal sinew
#

i just wrote "success" instead of sucess"

#

im so dumb lol

urban pecan
#

where

#

ss

#

it shouldnt change anything

#

u can call it whatever

#

unless u using it somewhere too

primal sinew
primal sinew
primal sinew
urban pecan
#

sus but ok

#

if it works it works