Chat Command /kick

Kicks player if chat command is /kick [playerName]. For example: /kick CoderBone

{
“triggers”: [
{
“type”: “playerSendsChatMessage”
}
],
“conditions”: [
{
“operator”: “==”,
“operandType”: “boolean”
},
true,
true
],
“actions”: [
{
“type”: “condition”,
“conditions”: [
{
“operandType”: “string”,
“operator”: “==”
},
{
“function”: “getPlayerName”,
“entity”: {
“function”: “getTriggeringPlayer”
}
},
“CoderBone”
],
“then”: [
{
“type”: “forAllPlayers”,
“playerGroup”: {
“function”: “humanPlayers”
},
“actions”: [
{
“type”: “condition”,
“conditions”: [
{
“operandType”: “string”,
“operator”: “==”
},
{
“function”: “getLastChatMessageSentByPlayer”,
“player”: {
“function”: “getTriggeringPlayer”
}
},
{
“function”: “concat”,
“textA”: "/kick “,
“textB”: {
“function”: “getPlayerName”,
“entity”: {
“function”: “selectedPlayer”
}
}
}
],
“then”: [
{
“type”: “kickPlayer”,
“entity”: {
“function”: “selectedPlayer”
},
“message”: {
“function”: “concat”,
“textA”: {
“function”: “getPlayerName”,
“entity”: {
“function”: “selectedPlayer”
}
},
“textB”: " has been kicked.”
}
},
{
“type”: “sendChatMessageToPlayer”,
“message”: “You have been kicked.”,
“player”: {
“function”: “selectedPlayer”
}
}
],
“else”:
}
]
}
],
“else”:
}
],
“name”: “/kick”,
“parent”: “u3BuCYnnM4”,
“key”: “EVGO0TcvBB”,
“order”: 11
}

4 Likes

this is very helpful thanks a lot @CoderBone :smiley: .

1 Like

Same as with your other post, please make a demonstration game.

1 Like

o im surprised people are actually active on here glad u found it helpful!

1 Like