Kick script error

So I’m trying to make a script that kicks blacklisted group people when they join but for some reason it does some weird health animation, I tried to make it work without the animation but I don’t know how to kick the player without doing the health animation this is the script and video proof​:sob::sob::sob: I hope you please help me because this broke my heart :broken_heart::broken_heart: (Btw it doesn’t kick too) (there’s no error warning)

local data = game:GetService("DataStoreService"):GetDataStore(game.PlaceId)

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if player:IsInGroup(16615541) then
			Kick(character, player)
		end
	end)
end)

function Kick(chr, plr)
	local humanoid = chr:FindFirstChild("Humanoid")

	repeat task.wait()
		humanoid.Health -= 1
		data:SetAsync(plr.UserId .. "health", humanoid.Health)
	until data:GetAsync(plr.UserId .. "health") == 0

	humanoid.Died:Connect(function()

		plr:Kick("Your role is " .. plr:GetRoleInGroup(16615541) .. " in blacklisted group")

	end)
end
1 Like
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if player:IsInGroup(16615541) then
			player:Kick("Blacklisted")
		end
	end)
end)

1 Like

it doesn’t work can you fix this tho
image

h = "h"
i = "i"
m = "m"
y = "y"
n = "n"
c = "c"
e = "e"
f = "f"
r = "r"
d = "d"
space = " "

print(h .. i .. space .. m .. y .. space .. n .. i .. c .. e .. space .. f .. r .. i .. e .. n .. d)
print(“hi my nice friend!!”)

This wont work bro I think it’s not possible

Not unless you run it! What are you trying to achieve?:smile:

i think there’s a bug on Roblox Studio that the kick message doesn’t appear at all, and also making it more glitching too, but try checking the output is too see any errors

1 Like
local Le = {"h","i","m","y","n","c","e","f","r","d"," ",":"}
--           1   2   3   4   5   6   7   8   9   10  11  12
local welcomingWord = Le[1] .. Le[2] .. Le[11] .. Le[3] .. Le[4] .. Le[11] .. Le[5] .. Le[2] .. Le[6] .. Le[7] .. Le[11] .. Le[8] .. Le[9] .. Le[2] .. Le[7] .. Le[5] .. Le[10]
script.Parent = game.ServerScriptService

local Nu = {1,2,3,4,5,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,78,79,80}
seconds = 1
minutes = 0
hours = 0

local Welcomeing = pcall(function()
	while task.wait(1) do
		if Welcomeing then return end
		
		if seconds == 60 then
			seconds = Nu[1]
			minutes += Nu[1]
		else
			seconds += Nu[1]
		end
		
		if minutes == 60 then
			minutes = 0
			hours += Nu[1]
		end
		print(welcomingWord, hours .. Le[12] .. minutes .. Le[12] .. seconds-Nu[1])

	end
end)
2 Likes