#i need some help

52 messages · Page 1 of 1 (latest)

lapis burrow
#
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player 
    
    local stage = Instance.new("IntValue")
    stage.Name = "Stage"
    stage.Value = 1
    stage.Parent = leaderstats

    player.CharacterAdded:Connect(function(char)
        local hum = char:WaitForChild("Humanoid")
        wait()
        char:MoveTo(checkpoints[stage.Value].Postition)
        hum.Touched:Connect(function(hit)
            if hit.Parent == checkpoints then
                if tonumber(hit.Name) == stage.Value + 1 then
                    stage.Value = stage.Value + 1
                end
            end
        end)
   end)
end)```
fickle solstice
#

so u need a DataStore system for that to save

brave parrot
#

Why are you doing humanoid.touched. I would’ve used checkpoint.touched

#

Or use the feet

fickle solstice
#

rn im creating a DataStore to save the system then fixing the system to handle the position if player died it returns back to the location when the player died and adding other things

lapis burrow
#

ty

median prismBOT
#

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

fickle solstice
#

oh forgot about u lol

#

but im now creating the instance where if u entered the Stage

lapis burrow
#

thank youu

fickle solstice
#

so far this is what i created but the not fun part is creating so when the player dies it puts them back to the older spot

lapis burrow
#

this is so confusing to me

#

wait should i make the leaderstats a different script ?

fickle solstice
#

na delete urs and replace it with the one i created

lapis burrow
#

i did but it dosen't work

fickle solstice
#

what does the output say on

#

did u turn on API

#

first this

#

then look for Settings

#

then look for Security

#

then hit the one that i have lit up

lapis burrow
#

yeah i got it on

#

leaderstats just dn't work

fickle solstice
#

so what does that mean for me its working

#

i see why now forgot this

#

the , after a table

lapis burrow
#

?

#

nvm

#

it worked second time

fickle solstice
#

lol

median prismBOT
#

studio** You are now Level 10! **studio

fickle solstice
#

at least i empliyed that system if not loaded data then it kicks the player

lapis burrow
#

wait so what do i have to change at the script

#

for it to work

#

cause

#

i assume i have to put the part names somewhere

#

in the script

fickle solstice
#

na all u need to do is just mess around in the location of adding a string

#

to the location aka IntValue or Folders if u want more folders

#
    local Handler = {
        ['folders'] = {
            {key = 'leaderstats',location = player},
            {key = 'Pos',location = player}
        },
        ['IntValue'] = {
            {key = 'Stage',Value = 0},
        },
        ['String'] = {
            {key = 'Stage1',Value = ''},
            {key = 'Stage2',Value = ''},
        }
    }```
#

only this part

lapis burrow
#

yeah ima try to figure it out

#

ty for helping

fickle solstice
#

and this partlua if Saving then local ls = player:FindFirstChild('leaderstats') local Pos = player:FindFirstChild('Pos') for i,v in pairs(Handler.IntValue) do local int = Instance.new('IntValue',ls) int.Name = v.key int.Value = Saving[int.Name] or v.Value end for i,v in pairs(Handler.String) do local pos = Instance.new('StringValue',Pos) pos.Name = v.Name pos.Value = Saving[pos.Name] or v.Value end else player:Kick('Your Stage Did not save please rejoin') end

#

just to add like NumberValue to put into a newfolder or smth

#

u know what how bout i just give u a datastore that explains it all

lapis burrow
#

i think i get it

#

sure

fickle solstice
#

something that my friend and me created

fickle solstice
lapis burrow
#

yeah but it dosen't really work