So, I am making a rank command, invoke a remote function with the person promoting, the person that will be promoted, a useless argument, and finally the rank chosen.
I set an if statement to detect if anything was nil.
If it was, it would ban the promoter.
however, whenever I run the remote function, it seems to think regardless if it is nil or not, its banning me.
im not sure why, i tried printing the values of the rank and the useless argument and it returned without nil.
game.ReplicatedStorage.eventcontainer.promoteFunction.OnServerInvoke = function(promoter,member,useless,rank)
local datastore = game:GetService("DataStoreService")
local Storage = datastore:GetDataStore(member.UserId.."Core")
local userId = promoter.UserId
local memUserId = member.UserId
local Players = game:GetService("Players")
local thumbType = Enum.ThumbnailType.HeadShot
local thumbSize = Enum.ThumbnailSize.Size420x420
local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
local contentp, poo = Players:GetUserThumbnailAsync(memUserId, thumbType, thumbSize)
print(rank)
print(useless)
if useless or rank == nil then
local datastorep = game:GetService("DataStoreService")
local Storagep = datastorep:GetDataStore(promoter.UserId.."Core")
Storagep:SetAsync("isBanned", true)
Storagep:SetAsync("Reason", "Exploiting: mod remote event");
Storagep:SetAsync("Moderator","Advanced Combat Safety Department")
Storagep:SetAsync("Date",os.date("*t", os.time()))
member:Kick("Hack on a lego game? You gotta be serious. \nYou have been banned from Advanced Combat. \nReason: Anti Cheat: Exploiting into remote events")
local url = ""
local http = game:GetService("HttpService")
local data = {
embeds = {
{
author = {name = "Advanced Combat Security"},
title = "Banned "..promoter.Name .." Indefinitely",
type = "rich",
description = "Exploiting | RE/RF nil",
}
}
}
local newdata = http:JSONEncode(data)
http:PostAsync(url,newdata)
return
end
end
this is the code that u are definitely needing, not all of it.