#Problems saving the game...

94 messages · Page 1 of 1 (latest)

chilly belfry
#

I'm having trouble saving my game... I've already tried doing the script myself, I've tried using AI and free models but I can't get the game to save anyway, can anyone help me?

indigo mauve
#

When you say saving your game do you mean that nothing loaded

chilly belfry
indigo mauve
#

im not the best at understanding leaderstats, but does it like automatically give u a value from the start and then when you make progression and leave the game and join back, does it lose the value you earnt?

chilly belfry
#

i dont understand

#

.. sorry

indigo mauve
#

so when u make progress you lose it

chilly belfry
#

the game is a click type when I click on a gui surface the leaderstats value increases... like this...

indigo mauve
#

is there a image?

rustic rootBOT
#

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

chilly belfry
indigo mauve
#

like how the game works or like a video

#

Well firstly if you want your game to allow saving stuff, enable studio access to** API services** in game settings

#

Also what is the value called

#

the leader stat value

indigo mauve
#

respond

chilly belfry
#

Sorry I can't respond, I'm back!

#

I have already activated the API! the names are Iron and Salt kkk

#

@indigo mauve

chilly belfry
#

just don't keep it...

indigo mauve
#

Its the best advice i could give LOL

coarse zenith
#

what do you mean by 'saving the game'

chilly belfry
#

what?

chilly belfry
#

i go tell you 1 sec

#

my game is a click game that when I click on a gui surface increases a value in the leaderstats (the name of the 2 values ​​are Iron and Salt) do you understand?

#

@coarse zenith

chilly belfry
#

you can help me?

coarse zenith
#

are you gonna tell me what the issue is?

chilly belfry
#

leaderstats is not saving...

#

@coarse zenith

coarse zenith
#

show scirpt

chilly belfry
#

I don't have any because none of them worked so I eliminated them

coarse zenith
chilly belfry
#

I'll do it!

chilly belfry
coarse zenith
#

?

chilly belfry
#

?

chilly belfry
#

I've already done it, can you tell me why it's not working?

#

@coarse zenith

#

sorry for taking so long

rustic rootBOT
#

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

chilly belfry
#

😦 @coarse zenith

coarse zenith
#

thats not how you use playerremoving

#

it gives you the player argument

chilly belfry
#

So how can I solve it?

coarse zenith
#

read this

chilly belfry
#

I've read it but I don't understand what the problem is

coarse zenith
#

move playerremoving event out of the playeradded event and make it there

#

god i am so tired hold on

chilly belfry
#

tipo isto?

chilly belfry
coarse zenith
chilly belfry
#

like this

#

sorry

coarse zenith
#
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
  -- this is when a player joins, the word player here is the player that joined
end)

Players.PlayerRemoving:Connect(function(player)
  -- this runs when a player leaves, and the word player here is the player that left
end)
coarse zenith
chilly belfry
#

ok

coarse zenith
#

for player

chilly belfry
#

i go try

#

like this?

#

@coarse zenith

coarse zenith
#

yea, remove the playerremoving in the playeradded function

chilly belfry
#

like this?

coarse zenith
#

yea

chilly belfry
#

it didn't work... it didn't save the leaderstats :/

#

@coarse zenith

coarse zenith
#

i don't know why but playerremoving does not work in studio for me, try in a live game

chilly belfry
#

before

#

after

#

l

#

when I come in again

#

@coarse zenith

#

It doesn't work inside the game unless it's from Roblox Studio...

coarse zenith
#

idk ask someone else im too tired to do basic thinking right now

#

good night

chilly belfry
#

ok bye good night

coarse zenith
#

oh yeah just so you know, im 90% sure thats not how you save tables, i never used datastoreservice so :shrug: