#leaderstats

1 messages · Page 1 of 1 (latest)

proper token
#

i need help with scipting my leaderstats
how do i make so everytime u pick up a cotton it adds 1 to the leaderstats value

#

please send a detailed explenation becouse i am a noob

#

both are normal scripts not local or module

sage kelp
#

you simply need the player

#

and then you gotta reference their leaderstats

#

so

#

plr.leaderstats.cotton.Value

#

its not really that hard

proper token
#

so like

sage kelp
#

you just gotta add 1 to it

proper token
#

in the growing scirpt

#

i do

#

local cottons = plr.leaderstats.cotton ?

sage kelp
#

yes

#

but you need to get the player first

proper token
#

how

sage kelp
#

the ProximityPrompt.Triggered event has an argument called "playerWhoTriggered"

proper token
#

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOH

sage kelp
#

if you put that in the function arguments you can easly get the player

proper token
#

ok so i put in the argument playerWhoTriggered

sage kelp
#

yea

proper token
#

it wants me to do playerWhoTriggered: Player

sage kelp
#

no need to do that

proper token
#

k

sage kelp
#

thats just a suggestion from the ai

proper token
#

k

#

i added this local player = playerWhoTriggered
local leaderstats = player:FindFirstChild("leaderstats")
local cottons = leaderstats:FindFirstChild("Cottons")
cottons.value = cottons.value + 1

slim escarpBOT
#

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

proper token
sage kelp
#

oh thats

#

not what i ment

#

cottonPrompt.Triggered:Connect(function(playerWhoTriggered)

#

thats what i mean when i say argument

proper token
#

i did thiscottonProx.Triggered:Connect(function(playerWhoTriggered)
cottonProx.Enabled = false
local player = playerWhoTriggered
local leaderstats = player:FindFirstChild("leaderstats")
local cottons = leaderstats:FindFirstChild("Cottons")
cottons.value = cottons.value + 1

sage kelp
#

oh you actually wrote value wrong

#

its Value

proper token
#

oh

#

YES IT WORKS

sage kelp
#

npè

dark patio
#

AYO

#

COTTON

#

@proper token

#

WHAT KIND OF GAME U MAKING BRUH

proper token
#

what

#

its GOOD lol

#

im not gonna publish it hto

#

i just did so that if you dont pick atlest 10 cotton a minute u die

dark patio
#

BRO

#

BI

#

NO

#

NO

#

THS IS INTENDING TO SMTH

#

10 COTTON A MINUTE U DIE

#

?]