Use DataStores to save checkpoint stages for your obby with this Roblox Scripting Tutorial from AlvinBlox. If you missed the previous video about creating obby checkpoints then make sure to watch it.
Link to previous video: https://youtu.be/Aa83VYif6VA
Become a Member today for exclusive perks and to support my channel!
►https://www.youtube.com/channel/UCp1R0TBvgM7gj0rwTYULmSA/join
Subscribe to my YouTube channel for more scripting videos:
►https://www.youtube.com/alvinblox?sub_confirmation=1
/>
► Watch my full beginner scripting series: https://goo.gl/k3erz2
Got video suggestions or feedback? Contact me via my website
►https://www.alvinblox.com/
Roblox username: Alvin_Blox
The music in this video is licensed from Epidemic Sound
http://www.epidemicsound.com
here killer block script that use
script.Parent.Touched:Connect(function(Hit)
if Hit and Hit.Parent and Hit.Parent:FindFirstChild("Humanoid")then
Hit.Parent.Humanoid.Health = 0
end
end)
What happens If I run out of brickcolourw?
could you make a skip stage tutorial for this?
The code I ended up with that worked was:
local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("ObbyDataStore")
game.Players.PlayerAdded:Connect(function(player)
local data
local success, errorMessage = pcall (function()
data = DataStore:GetAsync(player.UserId.."-stage")
end)
if success then
print("Success")
if data then
player.Team = game.Teams[data]
else
player.Team = game.Teams["Stage 1"]
end
else
player.Team = game.Teams["Stage 1"]
end
player:LoadCharacter()
end)
game.Players.PlayerRemoving:Connect (function(player)
local teamName = player.Team.Name
local success, errorMessage = pcall (function()
DataStore:SetAsync(player.UserId.."-stage",teamName)
end)
if success then
print("All went well")
else
print(errorMessage)
end
end)
Hope this helps!
8:06 my time he on line 24 of code
ah
idk i tried everything can someone please put the script
you truly are great!
Hi, I need help. I did what was here, even that debugging and i still spawn on start
I did the script but every time I go back in I always start on stage 2 and not stage 1 and when I leave the data doesn’t save
OH MY GOD THANK YOU IVE BEEN SCRIPTING FOR 2 dAYS TO TRY TO FIGURE OUT HOW TO DO IT
AND YOU DO IT IN 10 MINUTES YOU'rE A LIVESAVER
its helping me make a steeps steps cop… i mean, inspirated game!
15:07 for some reason on player load character it says "Failed to apply character appearance, player not in world". Literally tried making 4 games but every game had script error i couldn't understand or find it. I guess some people just can't be developers. I give up.
I would love it if you made a video explaining how we can make it to where players have to touch the spawn of the next stage and make it to where they cant touch a stage 10 stages ahead and can't touch spawns that are stages behind.