generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Cant add gui image upon death. Really stuck..

Previous Thread :: Next Thread 
PlaceRebuilder is not online. PlaceRebuilder
Joined: 29 Apr 2008
Total Posts: 1056
05 Dec 2012 05:33 PM
Hi,

I'v been bugged by this the last two days.
When a zombie dies, his humanoid has a stringvalue with the name of the last shooter.
When he dies, he finds the killer in players and give him an extra coin.
Now I want to give a gui headsup to the killer aswell in same code, but for some reason it just wont work.

function onDied()
local p = game.Players:FindFirstChild(killer.Value)
if p ~= nil then
if p:FindFirstChild("PlayerGui") ~= nil then
if p.PlayerGui:FindFirstChild("ScreenGui") ~= nil then
game.Lighting.GUI.visibletoenemy:clone().Parent = p.PlayerGui.ScreenGui
end
end
if p:FindFirstChild("leaderstats") ~= nil then
if p.leaderstats:FindFirstChild("Coins") ~= nil then
p.leaderstats.Coins.Value = p.leaderstats.Coins.Value +1
end
end
end
end


It still gives coins to the killer, so p ~= nil. visibletoenemy I am sure of exsist. I can see in the server that PlayerGui exsist with the ScreenGui screen inside.
Nothing is missing, but no gui appears to the other character.
Is it because it's a localscript or something?
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
05 Dec 2012 05:37 PM
Hello, thank you for posting here.

Create the died GUI. Put it in StarterGui. Insert a frame. Insert the contents into the frame. Make the frames visibility false. Insert a localscript into the ScreenGui, not the frame.. Paste this script into it:


game.Players.LocalPlayer.Character.Humanoid.Died:connect(function()
script.Parent.FrameName.Visible = true
end)


Thanks!

- thedestroyer115
Report Abuse
PlaceRebuilder is not online. PlaceRebuilder
Joined: 29 Apr 2008
Total Posts: 1056
05 Dec 2012 05:48 PM
Thank you for replying :P
But the gui should not appear when the player dies, but the enemy player dies.
The enemy player knows who kills him, and should give the killer (which is still alive) a popup screen that says (1+) This imagelabel has an "animation" script in it which runs and the removes the image.

Problem is the image is never placed in the killers gui :/
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
05 Dec 2012 05:51 PM
Okay, now I understand your issue.

What weapons are you using in your game? I will edit them for you, post the function that is fired when the weapon/weapon ammo touches an object.

- thedestroyer115
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
05 Dec 2012 05:52 PM
Could I recieve some credit in your game if I fix the scripts for you?

- thedestroyer115
Report Abuse
PlaceRebuilder is not online. PlaceRebuilder
Joined: 29 Apr 2008
Total Posts: 1056
05 Dec 2012 05:58 PM
I use rays, it's built prittie much from scratch all of them..
But I know how to do it that way, it's just that it feels.. Unnessecary..

But if no other solutions are avalible I'll do what I have to do :P
Don't need your help with the guns scripts but thank you very much for replying.
Very much appriciated :D
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
05 Dec 2012 05:59 PM
I need to see the touched script, so I can check if the humanoid your accessings health is at zero, and if so clone a GUI from lighting to the weapon handlers PlayerGui with proper information. That is how I will be doing it for my game.

- thedestroyer115
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
05 Dec 2012 06:01 PM
You're making a who killed who gui? Add a creator whenever the player hits it, then make a global gui for everyone to see then you could control from the player that died and list down who the creator was.

creator as in killer. I just use creator alot in my fighting games.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image