I cant read (charaaccteeeeeeeeerrrrrrrrr)
script.Parent.MouseButton1Up:Connect(function()
local PlayerName = script.Parent.Parent.PlayerName.Text
local Message = script.Parent.Parent.Message.Text
local Time = script.Parent.Parent.Time.Text
game.ReplicatedStorage.Misc.BanPlayer:FireServer(PlayerName, Message, Time)
end)
script.Parent.MouseButton1Up:Connect(function()
local PlayerName = script.Parent.Parent.PlayerName.Text
local Message = script.Parent.Parent.Message.Text
local Time = script.Parent.Parent.Time.Text
game.ReplicatedStorage.Misc.BanPlayer:FireServer(PlayerName, Message, tonumber(Time))
end)
local Time = tonumber(script.Parent.Parent.Time.Text)
local Time = tonumber(script.Parent.Parent.Time.Text)
local Time = tonumber(script.Parent.Parent.Time.Text)
local Time = tonumber(script.Parent.Parent.Time.Text)
please
Even if I do that I doesn’t work.
Oops im stupid my bad lemme try again
Have you tried again?, if its not that then the last thing that could be wrong is you named the text fields the wrong things and are mixing them up
ServerScriptService:
game.ReplicatedStorage.Misc.BanPlayer.OnServerEvent:Connect(function(Player, PlayerName, Message, Time)
local playerToBan = game.Players:FindFirstChild(PlayerName)
if playerToBan then
local BanSettings = {
UserIds = {playerToBan.UserId},
Duration = Time,
DisplayReason = Message,
PrivateReason = "Banned",
ExcludeAltAccounts = false,
ApplyToUniverse = true,
}
game.Players:BanAsync(BanSettings)
else
warn("Player not found: " .. PlayerName)
end
end)
LocalScript:
script.Parent.MouseButton1Up:Connect(function()
local PlayerName = script.Parent.Parent.PlayerName.Text
local Message = script.Parent.Parent.Message.Text
local Time = script.Parent.Parent.Time.Text
game.ReplicatedStorage.Misc.BanPlayer:FireServer(PlayerName, Message, tonumber(Time))
end)
Thank you so much it worked! That took us so long to figure out…
A pleasure to have helped you! :))
1st post … Time = tonumber(Time)
I tried that and didn’t work otherwise this topic would have been resolved a while ago.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.