Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
GunCoo 0
9 years ago

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
0
OMG... holy ****!!! davness 376 — 9y
0
ugh....free models. woodengop 1134 — 9y
0
Code block... unmiss 337 — 9y

1 answer

Log in to vote
-1
Answered by 9 years ago

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.

Ad

Answer this question