I made this but now im in need of help for making it work for a specific team. Like how do i start with making a script for the event to fire so the death gui would appear?
01 | game.ReplicatedStorage.DeadTribute.OnClientEvent:connect( function (playername) |
02 |
03 | script.Parent.Frame.Image.ImageLabel.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=420&y=420&Format=Png&username=" .. playername |
04 | script.Parent.Frame:TweenSize(UDim 2. new( 0 , 120 , 0 , 150 ), "In" , "Quart" , 0.5 , true ) |
05 | wait( 3 ) |
06 | if script.Parent.Frame.Image.ImageLabel.Image = = "http://www.roblox.com/Thumbs/Avatar.ashx?x=420&y=420&Format=Png&username=" .. playername then |
07 | script.Parent.Frame:TweenSize(UDim 2. new( 0 , 120 , 0 , 0 ), "In" , "Quart" , 0.5 , true ) |
08 | end |
09 | end |
10 | ) |
You can just do this as a LocalScript in StarterPack/StarterGui.
01 | local player = game.Players.LocalPlayer |
02 | local event = game.ReplicatedStorage:WaitForChild( 'DeadTribute' ) -- Make this variable your event |
03 | repeat wait() until player.Character |
04 | local char = player.Character |
05 | if char.Humanoid then |
06 | humanoid = char.Humanoid |
07 | end |
08 |
09 | humanoid.Died:Connect( function () |
10 | event:FireServer() |
11 | end ) |
01 | -- Set this in ServerScriptService |
02 |
03 | game.Players.PlayerAdded:Connect( function (player) |
04 | local val = Instance.new( "StringValue" ) -- Value Of The Team |
05 | local val 1 = Instance.new( "StringValue" ) -- Players name |
06 | val.Parent = player |
07 | val 1. Parent = player |
08 | val 1. Value = player.Name |
09 | local val 1 b = val 1. Value |
10 | while wait() do |
11 | val.Value = player.TeamColor |
12 | if game.Workspace.val 1 b.Humanoid.Health = 0 and val = "[Color of the team]" then |
13 | -- Do whatever you want to do with the GUI in here. |
14 | wait( 0.1 ) |
15 | end |
16 | end |