im not sure how to go about this
looking to use rbxasset to check for a file named password in folder extracontent on the localpc
its becuase i want to just give my freinds a file instead of having to whitelist everyone
im not sure how to go about this
looking to use rbxasset to check for a file named password in folder extracontent on the localpc
its becuase i want to just give my freinds a file instead of having to whitelist everyone
You can do this using ContentProvider:Preload() and ContentProvider:GetAssetFetchStatusChangedSignal(). However I don’t recommend using this method for whitelists as exploiters can easily abuse it.
Example:
local ContentProvider = game:GetService("ContentProvider")
local ExistsConnection: RBXScriptConnection? = nil
local Path = "rbxasset://hello.txt"
ExistsConnection = ContentProvider:GetAssetFetchStatusChangedSignal(Path):Connect(function(Status: Enum.AssetFetchStatus)
if (Status == Enum.AssetFetchStatus.Success) then
ExistsConnection:Disconnect()
print("File Exists")
return
elseif (Status == Enum.AssetFetchStatus.Failure or Enum.AssetFetchStatus.TimedOut) then
ExistsConnection:Disconnect()
print("Failed to find file")
return
end
end)
ContentProvider:Preload(Path)