well i did the same post a few hours ago but the bug dosent seem to be fixed
im a developer of a game and im trying to make a ban ui but it seems to not work
Local Script:
local button = script.Parent
local user = script.Parent.Parent.TextBox
local userreason = script.Parent.Parent.TextReason
button.MouseButton1Click:Connect(function()
game.ReplicatedStorage["Banny_Binny!"]:FireServer(user.Text, userreason.Text)
user.Text = "Player Succesfully BANNED"
userreason.Text = "Reason"
task.wait(1)
user.Text = "username"
end)
Normal Script:
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, player.UserId) 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)
and heres the error code
and the spot of the error code:
function convertHoursIntoSecends(hours)
return 3600 * tonumber(hours)
end
(sorry if i put too much detail i just want to fix it)