So, I am trying to make a whitelist system for something I am making. And I have this script,
local HttpService = game.HttpService
warn("Checking for purches")
local URL = "https://api.cheesycorp.tk/pole/".. game.CreatorId
local ReceivedData = HttpService:GetAsync(URL)
local Data = HttpService:JSONDecode(ReceivedData)
print(URL)
print(game.CreatorId)
local user = Data[1].userid
print(user)
if user == game.CreatorId then
warn("Purches found.")
print(ReceivedData)
script.Script.Disabled = false
script.Script:Clone().Parent = game.Workspace
script.ScreenGui:Clone().Parent = game.StarterGui
else warn("No purches found. Deleteing")
script:Destroy()
end
I am wondering what is happening. Because when I run the script, I get the else part instead. I want to know what this is happening, and If I can prevent it from happening.
@Crowdsource It seemed to pick up the creator id and output the right thing. @archisaurus When I print user I get the same id as the creator id and @IAmPinleon
16:58:13.103 - Checking for purches
Realism Mod is currently running v2.08!
https://api.cheesycorp.tk/pole/5196118
5196118 (This is the creatorId)
16:58:16.437 - No purches found. Deleteing
The creator id you guys are using doesn’t seem to exist, it just leads me to an random account, while i thought/think that it would bring me into your account.
One reason this might not be working is because if game.CreatorIdis a group id like @LukaDev_0 has mentioned then user == game.CreatorId will never be true, because i’m pretty sure that user is meant to be a user id no? , thus: