Making a Kill Receiver like Arsenal?

,

Hello there Developers!

I hope your doing fine! I was making an FPS game with Kill Receivers like Arsenal
How do i do that?

2 Likes

I have no idea what a kill receiver is. Could you elaborate?

4 Likes

Like Arsenal.

For Example, If you Kill Player1, A Text Label will become visible saying “Player2 killed Player1”

1 Like


Here

The Template “Player1 Killed Player2”

1 Like

do you have a remote event when damaging a player

1 Like

Ok. What you are looking for is something similar to a damage indicator system (DIS). There’s a few tutorials around that will help you with this. But the basic steps of it is this.

  1. Create a 2D overlay (ScreenGui). I used a text box.
  2. Have the server fire an event to the client. This information should contain the names of the players, and the world location (The 3D coordinates) of the killed player.
  3. On the client, when you get the event, you need to use Camera:WorldToViewPortPoint(position) to convert the world coordinate to a screen coordinate.
  4. Set the position of the textbox, the text, and make is visible.

I have done this, twice. Once for a damage indicator system, the second for an awards indication system (cash and xp gains). Here is the tutorial that I used as a template for my systems: https://devforum.roblox.com/t/how-to-implement-a-damage-indication-system/483161

You can actually see this in my game, The Proving Grounds which is currently open. It’s VERY alpha stage, but just about everything works, and there’s a little bit of lag around the castle, but that’s due to the number of parts. Note: Rocket Launcher and Grenade Launcher explosions don’t do any damage, which is an issue that I’m working on.

Alternatively, you can also print messages in the chat. I do this as well in several channels.

1 Like

Nope, Not yet…Do i need to add?

1 Like

I used Sub2HTR’s Damage Indicator that uses BillboardGui. And tests it in Dummies. It didn’t work, And i tried it in Real players. It didnt work either.

Here is SUb2HTR’s code:

local tweenService = game:GetService("TweenService")

local tweenInfo = TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)

local DamageNPCs = true

local damageForColours = 
{
	[25] = Color3.fromRGB(255, 255, 0),
	[50] = Color3.fromRGB(255, 170, 0),
	[75] = Color3.fromRGB(255, 85, 0),
	[100] = Color3.fromRGB(255, 0, 0),
}

game.Players.PlayerAdded:Connect(function(plr)
	
	plr.CharacterAdded:Connect(function(char)
		
		local humanoid = char:WaitForChild("Humanoid")
		local currentHealth = humanoid.Health
		
		humanoid.HealthChanged:Connect(function(health)
			
			if health < currentHealth and humanoid:GetState() ~= Enum.HumanoidStateType.Dead then
			
				local healthLost = math.floor(currentHealth - health)
				
				
				local damageIndicatorGui = Instance.new("BillboardGui")
				damageIndicatorGui.AlwaysOnTop = true
				
				damageIndicatorGui.Size = UDim2.new(1.5, 0, 1.5, 0)
				
				local offsetX = math.random(-10, 10)/10
				local offsetY = math.random(-10, 10)/10
				local offsetZ = math.random(-10, 10)/10
				damageIndicatorGui.StudsOffset = Vector3.new(offsetX, offsetY, offsetZ)
				
				local damageIndicatorLabel = Instance.new("TextLabel")
				
				damageIndicatorLabel.AnchorPoint = Vector2.new(0.5, 0.5)
				damageIndicatorLabel.Position = UDim2.new(0.5, 0, 0.5, 0)
				
				damageIndicatorLabel.TextScaled = true
				damageIndicatorLabel.BackgroundTransparency = 1
				damageIndicatorLabel.Font = Enum.Font.GothamBlack
				
				damageIndicatorLabel.Text = healthLost
				
				damageIndicatorLabel.Size = UDim2.new(0, 0, 0, 0)
				
				for damage, colour in pairs(damageForColours) do
					
					if healthLost <= damage then 
						
						damageIndicatorLabel.TextColor3 = colour
						damage = 100
					end
				end
				
				damageIndicatorLabel.Parent = damageIndicatorGui
				
				damageIndicatorGui.Parent = char.HumanoidRootPart
				
				damageIndicatorLabel:TweenSize(UDim2.new(1, 0, 1, 0), "InOut", "Quint", 0.3)
				
				
				wait(0.3)
				
				local guiUpTween = tweenService:Create(damageIndicatorGui, tweenInfo, {StudsOffset = damageIndicatorGui.StudsOffset + Vector3.new(0, 1, 0)})
				
				local textFadeTween = tweenService:Create(damageIndicatorLabel, tweenInfo, {TextTransparency = 1})
				
				guiUpTween:Play()
				textFadeTween:Play()
				
				game:GetService("Debris"):AddItem(damageIndicatorGui, 0.3)
			end
			
			currentHealth = humanoid.Health
		end)
	end)
end)

I tried it on Dummies and Real Players. It won’t work.

EDIT: I placed it on ServerScriptService
I tried adding “DamageNPC’s = true” it won’t work either

1 Like

You can do something like this, To avoid using any more remote events

Screenshot 2022-09-08 121655

local Players = game:GetService("Players")
local Debris = game:GetService("Debris")

local RemoteEvent = -- fill this in
local Killfeed = workspace.Killfeed

RemoteEvent.OnServerEvent:Connect(function(Player, Target, Damage)
	local Humanoid = Target:FindFirstChildOfClass("Humanoid")
	
	if Humanoid and Humanoid.Health > 0 then
		Humanoid:TakeDamage(Damage)
		
		if Humanoid.Health <= 0 then
			local Folder = Instance.new("Folder")
			Folder.Name = #Killfeed:GetChildren()
			Folder.Parent = Killfeed
			
			local Killer = Instance.new("ObjectValue")
			Killer.Name = "Killer"
			Killer.Value = Player
			
			local Killed = Instance.new("ObjectValue")
			Killed.Name = "Killed"
			Killed.Value = Players:GetPlayerFromCharacter(Target)
			
			Debris:AddItem(Killfeed, 5)
		end
	end
end)
2 Likes

Where do i put that Script? ServerScriptService?

1 Like

It would probably work on workspace and serverscriptservice

1 Like

Does it work on Dummies too? Sorry for alot of Questions… :sweat_smile:

What are those Values? IntValue?

1 Like

If you change this

to

local Killed = Instance.new("StringValue")
Killed.Name = "Killed"
Killed.Value = Target.Name
1 Like

So that would be “StringValue”?

1 Like

FE GUN KIT Test place has a script like that, you can just borrow it and edit it if you wanna. it’s very customizable.

2 Likes

Can you send me a link to it? Please.

1 Like

And by the way, I used XTurbo21’s Gun Kit from PF, Cuz movements are so realistic

1 Like

Yes, i forgot to add “Value”

also GUI:

Screenshot 2022-09-08 123709

local KillFeed = -- Fill it in again
local Feeds = script.Parent.Feeds

local function RefreshFeed()
	for i, OldFeed in pairs(Feeds:GetChildren()) do
		if OldFeed:IsA("TextLabel") then
			OldFeed:Destroy()
		end
	end
	
	for i, Feed in pairs(KillFeed:GetChildren()) do
		local Template = script.Parent.Template:Clone()
		Template.Text = Feed.Killer.Value.Name .. " has killed " .. Feed.Killed.Value
		Template.Parent = Feeds
		Template.Visible = true
	end
end

Also use the RemoteEvent or it wont work

1 Like

And btw @BirdieI90 , There is an Error.

1 Like

Because you didn’t fill in the remote event

3 Likes