Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

This script is not working, can anyone locate my problem?

Im trying to make a script where when you get a kill in my game, a message comes up on the screen saying nice kill. The message types out on the screen so it needs to be placed in the gui. But I only want is to be placed in the gui when that player gets a kill, and then I want it removed from the gui after its finished. Heres what I got so far. The name of my gui is called (killmessage) and right now, its located in the Lighting.


  1. function handleKillCount(humanoid, player)
  2. local killer = getKillerOfHumanoidIfStillInGame(humanoid)
  3. if killer ~= nil then
  4.  local stats = killer:findFirstChild("leaderstats")
    
  5.  if stats ~= nil then
    
  6.      local kills = stats:findFirstChild("Kills")
    
  7.      if killer ~= player then
    
  8.          kills.Value = kills.Value + 1
    
  9.          game.Lighting:FindFirstChild(KillMessage):Clone().Parent = player.PlayerGui
    
  10.     else
    
  11.         kills.Value = kills.Value - 1
    
  12.     end
    

3 comments

0

OMG... holy ****!!!

0

ugh....free models.

0

Code block...

1 answer

I noticed that you put:

if killer ~= player then
-- and
game.Lighting:FindFirstChild(KillMessage):Clone().Parent = player.PlayerGui -- look, to player's player GUI. Why's that?

A little Mistake, I guess.

This discussion is preserved as it was. New answers, comments, and votes are closed.