How to make an kick message with moderator and reason

hello,
I saw somebody with basic admin question that here, but I don’t have basic admin so yeah, I want to make that also with my group ranks and not with names.

so what I want:

!kick [player]

then the player sees:

you are kicked from this game:

You are kicked from Utopia Hotels

Moderator: [mod]

Reason: [reason]

does anyone know how to make this?

1 Like

Do you mean somthing like this?

local PlayerService = game:GetService("Players")
local Prefix = "!"

PlayerService.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(msg)
		if string.find(msg, Prefix.."kick") then
			local SplitMessage = msg.split(msg, " ")
			local playerToKick = SplitMessage[2]
			local Reason = SplitMessage[3]
			local ModName = plr.Name
			if not Reason then
				PlayerService:WaitForChild(playerToKick):Kick("You have been kicked from Utopia Hotels Moderator: "..ModName.." Reason: Not Given")
			end
			PlayerService:WaitForChild(playerToKick):Kick("You have been kicked from Utopia Hotels Moderator: "..ModName.." Reason: "..Reason)
		end
	end)
end)
1 Like

Uhh only how to set the perms

2 Likes

Something like:

MinRank  = 7
if plr:GetRankInGroup(GroupID) >= MinRank then 
1 Like

Where need the group Id?

You can simply define the GroupID

local GroupID = 123456

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.