ok so i have a script inside of a bomb that of course creates an explosion but it also creates a value of the player who placed it which both work fine but i am trying to figure out a way to make the game add points to a player that kills another player or players with said explosion
script that makes the owner value and clones the bomb
game.ReplicatedStorage.DropBomb.OnServerEvent:Connect(function(Player,Spot,RootPart)
local Bomb = game.ReplicatedStorage.BombBag
local Clone = Bomb:Clone()
Clone.Parent = workspace
Clone.Position = RootPart.Position - Vector3.new(3,0,0)
local Owner = Instance.new("StringValue")
Owner.Parent = Clone
Owner.Value = Player.Name
end)
localscript that that tells the server to make the bomb
local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local character = player.CharacterAdded:wait()
local humanoid = character:WaitForChild("Humanoid")
local RootPart = character.HumanoidRootPart
local Spot = RootPart.Position
local BombDropped = false
game:GetService("UserInputService").InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.F then
if not BombDropped then
BombDropped = true
game.ReplicatedStorage.DropBomb:FireServer(Spot,RootPart)
wait(5)
BombDropped = false
end
end
end
end)
sorry im not good at wording things

2 comments
Just like you assigned an Owner value, use that check in your explosion event or whatever way you’re doing the damage. If the value is the same, then alter their leaderstats from there.
not sure how i would do that tho something like when a player is killed check which Owner value was in the bomb that killed them but im not sure how to go about scripting that