#leaderstats
1 messages · Page 1 of 1 (latest)
please send a detailed explenation becouse i am a noob
both are normal scripts not local or module
you simply need the player
and then you gotta reference their leaderstats
so
plr.leaderstats.cotton.Value
its not really that hard
so like
you just gotta add 1 to it
how
the ProximityPrompt.Triggered event has an argument called "playerWhoTriggered"
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOH
if you put that in the function arguments you can easly get the player
ok so i put in the argument playerWhoTriggered
yea
it wants me to do playerWhoTriggered: Player
no need to do that
k
thats just a suggestion from the ai
k
i added this local player = playerWhoTriggered
local leaderstats = player:FindFirstChild("leaderstats")
local cottons = leaderstats:FindFirstChild("Cottons")
cottons.value = cottons.value + 1
** You are now Level 3! **
but it says value is not a valid member for Players.(myuser).leaderstats.Cottons
oh thats
not what i ment
cottonPrompt.Triggered:Connect(function(playerWhoTriggered)
thats what i mean when i say argument
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
npè