local ps = game:GetService("Players")
function convertDaysToSecends(days)
return 86400 * tonumber(days)
end
function convertHoursIntoSecends(hours)
return 3600 * tonumber(hours)
end
game.ReplicatedStorage["Banny_Binny!"].OnServerEvent:Connect(function(player, bannedplr, banrsn)
local plr = ps:FindFirstChild(bannedplr)
local config: BanConfigType = {
UserIds = ps:GetUserIdFromNameAsync(plr),
Duration =tonumber(player.PlayerGui.Admn.Frame.TextDurationSeconds.Text) or convertHoursIntoSecends(tonumber(player.PlayerGui.Admn.Frame.TextDurationHours.Text)) or convertDaysToSecends(tonumber(player.PlayerGui.Admn.Frame.TextDurationDays.Text)),
DisplayReason = banrsn,
PrivateReason = "This Player Got Banned Because of:"..banrsn
}
local success, errorMessage = pcall(function()
return ps:BanAsync(config)
end)
if success then
print("THE ALMIGHTY BAN CAME")
else
warn("i no no wanna ban")
end
end)
if this isn’t assigned to on the server, it’ll be viewed as what you set it to before, likely the value it has in StarterGui… so probably nil. You need to get the correct value on the server for the multiplication to work.
You’re passing the text as a parameter to that, which is causing your issue - the server is viewing it as nil because when the client updates it it doesn’t replicate. Try sending it to the server from the client and using that value.
local ps = game:GetService("Players")
function convertDaysToSecends(days)
return 86400 * tonumber(days)
end
function convertHoursIntoSecends(hours)
return 3600 * tonumber(hours)
end
local AllowedPeople = {
1813216757,
1915724787,
1029123331,
2728185622,
}
game.ReplicatedStorage["Banny_Binny!"].OnServerEvent:Connect(function(player, bannedplr, banrsn)
if not table.find(AllowedPeople) then
return
end
local plr = ps:FindFirstChild(bannedplr)
local config: BanConfigType = {
UserIds = ps:GetUserIdFromNameAsync(plr), -- couldnt get this to a pcall statement :()
Duration =tonumber(player:WaitForChild("PlayerGui").Admn.Frame.TextDurationSeconds.Text) or convertHoursIntoSecends(tonumber(player:WaitForChild("PlayerGui")..Admn.Frame.TextDurationHours.Text)) or convertDaysToSecends(tonumber(player:WaitForChild("PlayerGui").Admn.Frame.TextDurationDays.Text)),
DisplayReason = banrsn,
PrivateReason = "This Player Got Banned Because of:"..banrsn
}
local success, errorMessage = pcall(function()
return ps:BanAsync(config)
end)
if success then
print("THE ALMIGHTY BAN CAME")
else
warn("i no no wanna ban")
end
end)
i get it was a joke but you said “thats why im making a ban system duh” in response to “hackers can just fire the remotes” which i dont really understand how it makes sense. It sounded to me like you didn’t get that other people could fire the remote.
I give up… XD
anyway
that should be
if not table.find(AllowedPeople, player.UserId) then return end