Hi, I’m making a small FPS game, and I need help with my on-kill GUI, which doesn’t show up.
When a player is killed their camera is sent to the killer’s head, showing the player who died who killed them.
I wanted to add a bit more flair to this, since I already had the killcam scripted, I used this guide to help me set up the GUI pop-up. The popups in my game are this:
The frame has an ImageLabel and a TextLabel, and the frames are the letterbox.
In-game, it should look like this, pretend this dummy killed you.
But as I said earlier, it does not show up. Here’s how it currently looks in-game, the killcam works but the popup does not.
I followed the guide and tried to modify the script to work with my GUIs. I’m not sure if there’s something wrong with the properties or the script.
This is the script:
local frame = script.Parent.Frame
local player = game.Players.LocalPayer or game.Players.PlayerAdded:Wait()
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
local murder = character.Humanoid:FindFirstChild("creator")
local murderCharacter = murder.Value.Character
local murderName = murder.Value.Name
if murder.Value then
script.Parent.bar.Visible = true
frame.Visible = true
frame.TextLabel.Text = murderName.." has killed you!"
wait(8)
script.Parent.bar.Visible = false
frame.Visible = false
end
end)
I’m not sure what’s wrong with it, but if you do, then please don’t hesitate to tell! Thanks for reading, I hope this can help myself and others learn.