I need help with my data store script?
I would put data store in the tags but there is only data persistence so yeah @mod. There is no error in the output and here the script is...
01 | game.Players.PlayerAdded:connect( function (plr) |
02 | local level = Instance.new( "StringValue" ) |
06 | local chkpt = Instance.new( "IntValue" ) |
09 | chkpt.Name = "Checkpoint" |
10 | HighLevel = Instance.new( "IntValue" ) |
12 | HighLevel.Name = "highlev" |
14 | ds = game:GetService( "DataStoreService" ):GetDataStore( "HighLevel" ) |
15 | data = ds:GetAsync(ID) or ds:SetAsync(ID, { |
18 | plr.CharacterAdded:connect( function (char) |
19 | local chkptGroup = Workspace:FindFirstChild(level.Value:sub( 1 , 1 ):upper() .. level.Value:sub( 2 ):lower() .. "Checkpoints" ) |
21 | print ( "Found " .. chkptGroup.Name) |
22 | local spawn = chkptGroup:FindFirstChild( tostring (chkpt.Value)) |
24 | print ( "Found spawn, " .. spawn:GetFullName()) |
26 | char:WaitForChild( "Torso" ).CFrame = spawn.CFrame + Vector 3. new( 0 , 4 , 0 ) |