Kick player for robux

Hi developers, i want to make a kick system but i can’t please help me.

  1. What do you want to achieve? I want to make a system that if a player buys a dev product he can enter a username from someone in the server and then that person got kicked

  2. What is the issue? The issue is that i have no idea how to make this

  3. What solutions have you tried so far? I looked on youtube and de developer forum but i can’t find anything.

Please let me know if you know how to make this.

1 Like

Make a devproduct system, that gets the person the purchaser wwants to kick.
Then when the devproduct is processed, kick the player

2 Likes

i"m gonna try that, thank you for helping!

1 Like

I’ve made the devproduct and the scripts. But the UI is not showing up. This is my script : ''local MarketplaceService = game:GetService(“MarketplaceService”)

local function ProcessReceipt(receiptInfo)
local player = game:GetService(“Players”):GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
print(player.Name…“just bought”…receiptInfo.ProductId)
game.Players.PlayerGui.KickSystem.Frame.Visible = true
return Enum.ProductPurchaseDecision.PurchaseGranted
end

MarketplaceService.ProcessReceipt = ProcessReceipt ‘’

1 Like

I Don’t Use devproducts That Often But Here Is A Script Example

local MarketplaceService = game:GetService("MarketplaceService")
local DataStoreService = game:GetService("DataStoreService")
local Players = game:GetService("Players")
 
local purchaseHistoryStore = DataStoreService:GetDataStore("PurchaseHistory")
 
local productFunctions = {}
--// Change The Numbers With Your Product ID
productFunctions[123456] = function(receipt, player)
	player:Kick("Whatever The Reason You Want, Or Just Remove It")
end
 
local function processReceipt(receiptInfo , PlayerToKick)
 
	local playerProductKey = receiptInfo.PlayerId .. "_" .. receiptInfo.PurchaseId
	local purchased = false
	local success, errorMessage = pcall(function()
		purchased = purchaseHistoryStore:GetAsync(playerProductKey)
	end)
	if success and purchased then
		return Enum.ProductPurchaseDecision.PurchaseGranted
	elseif not success then
		error("Data store error:" .. errorMessage)
	end
 
	local player = Players:FindFirstChild(PlayerToKick.Name)
	
	if not player then warn("Player Isn't In The Game!") return end
	
	local handler = productFunctions[receiptInfo.ProductId]
 
	local success, result = pcall(handler, receiptInfo, player)
	if not success or not result then
		warn("Error occurred while processing a product purchase")
		print("\nProductId:", receiptInfo.ProductId)
		print("\nPlayer:", player)
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
 
	local success, errorMessage = pcall(function()
		purchaseHistoryStore:SetAsync(playerProductKey, true)
	end)
	if not success then
		error("Cannot save purchase data: " .. errorMessage)
	end
 
	return Enum.ProductPurchaseDecision.PurchaseGranted
end
 
MarketplaceService.ProcessReceipt = processReceipt

and In Another script Use PromptProductPurchase --Fix some stuff btw

1 Like

To change the visibility of the GUI, you will have to do it on from the client. This can be achieved using local scripts

1 Like

remember to always use

code blocks!
1 Like