Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RequestService = game:GetService("ServerStorage"):WaitForChild("RequestService")
- local DSS = game:GetService("DataStoreService")
- local ThisDS = DSS:GetDataStore("Example")
- local RequestInformationRemoteFunction = ...
- function RequestInfo(plr,key)
- local info
- --
- local canPlrProceed = RequestService:RequestToProceed("GetInfo", 6, plr.UserId)
- if canPlrProceed and KeyIsLegit(key) then
- local success, response = pcall(function()
- ThisDS:UpdateAsync(key, function(pastData)
- info = pastData
- end)
- end)
- --
- if not success then
- print(response)
- info = "Pcall failed!"
- end
- else
- if not canPlrProceed then
- info = "You cannot get information yet. Please wait!"
- else
- info = "Unsupported key for datastores!"
- end
- end
- --
- return info
- end
- RequestInformationRemoteFunction.OnServerInvoke = RequestInfo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement