Hello! I made an admin Console but I’m not sure where I fire the code whereas when I click a day ban for a player. None of my methods seem to be working. Essentially, what I need is to fire code when an admin clicks this:
I am just not sure how I would respond to the remote fired when clicked, or where I should respond to it. Here is my code:
game.Players.PlayerAdded:Connect(function(player)
local timeNow = os.time()
local VIPdata
pcall(function()
VIPdata = myYtData:GetAsync(player.UserId.."-Bans")
end)
print(VIPdata)
if VIPdata ~= nil then
-- Returning Player
local timeSinceLastVIPClaim = timeNow - VIPdata
print(timeSinceLastVIPClaim.." Was The Player's Last CLaim")
if (timeSinceLastVIPClaim / 3600) >= weekWait then
VIPdata = myYtData:RemoveAsync(player.UserId.."-Bans")
else
player:Kick("You have been banned by an Administrator for 1 Day.")
end
else
-- New Player
VIPdata = myYtData:SetAsync(player.UserId.."-Bans", os.time())
print(VIPdata)
end
end)