I can't give kill point

Kill points are not gived.

GetPlayer is the player who will receive the kill point.

Please make it into a script that will give you a kill point please

if part.Parent:FindFirstChild("Humanoid") then 
			local character = part.Parent -- creates a variable of the character
			local player = game.Players:GetPlayerFromCharacte(character) -- gets the player
       
			if player then  
			getPlayer().leaderstats.BOMB.Value += 1
			end
		end
3 Likes

First off, we are not here to write entire scripts for you. This is even mentioned in forum rules.
Second, did you generate this from ChatGPT? Because I cannot understand what getPlayer() function does even though the player variable is already set by calling the method :GetPlayerFromCharacter(character)

Anyway, try replacing getPlayer() with player and check the result.

I don’t know if you watched a tutorial or something but what does the getPlayer() function do? You’re already getting the Player above using GetPlayerFromCharacter().

Instead of

if player then
getPlayer().leaderstats
end

You should do

if player then
player.leaderstats
end

I think the others aren’t getting it. This script is, as far as I understood, the children of the player killed, meaning “player” is that player instance. Of course you don’t want to give the person that got killed the kill point and other users wrote “player.leaderstats” which in this case would absolutely be wrong. I have solved your case before and I recommend you a tagging system as it’s the most reliable.
Here’s the regarding post with all the code:

first this line is wrong it should be

local player = game.Players:GetPlayerFromCharacter(character)

you misspelled one symbol.

Second of all why you use getPlayer()??
just do

player.leaderstats.BOMB.Value += 1

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