Hello there Developers!
I hope your doing fine! I was making an FPS game with Kill Receivers like Arsenal
How do i do that?
Hello there Developers!
I hope your doing fine! I was making an FPS game with Kill Receivers like Arsenal
How do i do that?
I have no idea what a kill receiver is. Could you elaborate?
Like Arsenal.
For Example, If you Kill Player1, A Text Label will become visible saying “Player2 killed Player1”
do you have a remote event when damaging a player
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.
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.
Nope, Not yet…Do i need to add?
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
You can do something like this, To avoid using any more remote events
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)
Where do i put that Script? ServerScriptService?
It would probably work on workspace and serverscriptservice
Does it work on Dummies too? Sorry for alot of Questions…
What are those Values? IntValue?
If you change this
to
local Killed = Instance.new("StringValue")
Killed.Name = "Killed"
Killed.Value = Target.Name
So that would be “StringValue”?
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.
Can you send me a link to it? Please.
And by the way, I used XTurbo21’s Gun Kit from PF, Cuz movements are so realistic
Yes, i forgot to add “Value”
also GUI:
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
Because you didn’t fill in the remote event