Hello! I want to make my own pre banned players system, But I do not know how to make the player not move. Here is my script. (basically I Don’t want them to be able to move.)
local BannedGui = script.BannedGui
local BannedText = "You have been banned from this game."
game.Players.PlayerAdded:Connect(function(player)
if player.Name == "Censored for privacy reasons." then
Lighting.Blur.Size = 50
BannedGui.Parent = game.StarterGui
script.BannedGui.Frame.Reason.Text = BannedText
wait(5)
player:Kick("You have been banned from this server.")
end
end)
local BannedGui = script.BannedGui
local BannedText = "You have been banned from this game."
local ContextActionService = game:GetService("ContextActionService")
game.Players.PlayerAdded:Connect(function(player)
if player.Name == "###########" then
Lighting.Blur.Size = 50
BannedGui.Parent = game.StarterGui
script.BannedGui.Frame.Reason.Text = BannedText
wait(5)
player:Kick("You have been banned from this server.")
ContextActionService:BindAction(Enum.KeyCode.W, Enum.KeyCode.A, Enum.KeyCode.S, Enum.KeyCode.D)
end
end)
I changed the selected name to TrackoTheTaco so I can test it and it did not work.
local controls = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule")):GetControls()
local BannedGui = script.BannedGui
local BannedText = "You have been banned from this game."
game.Players.PlayerAdded:Connect(function(player)
if player.Name == "##############" then
Lighting.Blur.Size = 50
BannedGui.Parent = game.StarterGui
script.BannedGui.Frame.Reason.Text = BannedText
controls:Disable()
wait(5)
player:Kick("You have been banned from this server.")
end
end)
game.Players.PlayerAdded:Connect(function(player)
if player.Name == "Censored for privacy reasons." then
player.CharacterAdded:Connect(function(char)
char:WaitForChild("HumanoidRootPart").Anchored = true
end)
end
end)
Note that the character might stay in the air which you can fix by adding a wait before anchoring the HumanoidRootPart.