Help with Detecting Humanoid Easy Fix I quess

So I was making gamepass what u can buy by touching and it gives u the item it works, BUT blocks can fire the script too so I was wondering how only humanoid can fire it so like if touched thing == humanoid then fire and if touched thing == block then not fire example, thanks!


local clicker = game.Workspace.Seller

local mps = game:GetService("MarketplaceService")
local gamepass_id = 13538006


clicker.Touched:Connect(function()

	local player = game.Players.LocalPlayer
	mps:PromptGamePassPurchase(player, gamepass_id)

end)

mps.PromptGamePassPurchaseFinished:Connect(function(player, id, purchased)
	if id == gamepass_id and purchased then
		game.ReplicatedStorage.Give6:FireServer()
	end
end)
clicker.Touched:Connect(function(Hit)
    if Hit.Parent:FindFirstChild("Humanoid") then
      --is a humanoid!
   end
end

You can do something like this.

1 Like

I doesn’t work for findfirstchild but it workd for WaitForChild but it gets infinite weld maybe i will put else!

It will work with :FindFirstChild(), did you get any error?

It worked i dont know maybe i miss typed the first time thanks i will mark u as solution!