So i am doing a game, and i need for it to check, if player did the obstacle course, well, i could use data stores, but it won't be as effective as it needs to.
dataStore = game:GetService("DataStoreService") obbyStore1 = dataStore:GetDataStore("ObbyStore1") -- and such stuff
Is there any better way?
Assuming the script is in a block that detects if they reached it, your script would be:
dataStore = game:GetService("DataStoreService") obbyStore1 = dataStore:GetDataStore("ObbyStore1") script.Parent.Touched:Connect(function(hit) local player = game.Players:FindFirstChild(hit.Parent.Name) if player then --check if theyre in the obby datastore local hasCompletedObby = obbyStore1:GetAsync(player.UserId) --if theyre not in ds/ reward player and add them to the datastore if(not hasCompletedObby)then --TODO: reward player for completing obby obbyStore1:SetAsync(player.UserId) end end end)
(this is repeating of commect i posted) Ok thanks, now i know if player already did the obstacle course, but i need to know total amount of obstacle courses, because it's not just 1 obby
dataStore = game:GetService("DataStoreService") obbyStore1 = dataStore:GetDataStore("ObbyStore1") obbyStore2 = dataStore:GetDataStore("ObbyStore2")