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

Need assistance firing this event for my Death GUI?

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?


game.ReplicatedStorage.DeadTribute.OnClientEvent:connect(function(playername)
	
	script.Parent.Frame.Image.ImageLabel.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=420&y=420&Format=Png&username=" .. playername
	script.Parent.Frame:TweenSize(UDim2.new(0, 120, 0, 150), "In", "Quart", 0.5, true)
	wait(3)
	if script.Parent.Frame.Image.ImageLabel.Image == "http://www.roblox.com/Thumbs/Avatar.ashx?x=420&y=420&Format=Png&username=" .. playername then
		script.Parent.Frame:TweenSize(UDim2.new(0, 120, 0, 0), "In", "Quart", 0.5, true)
	end
end
)

2 comments

0

I have no idea what you're asking.

0

I'm trying to make it so that when a person on a specific team dies, The death GUI would appear.

2 answers

✓ Accepted answer

You can just do this as a LocalScript in StarterPack/StarterGui.

local player = game.Players.LocalPlayer
local event = game.ReplicatedStorage:WaitForChild('DeadTribute') -- Make this variable your event
repeat wait() until player.Character
local char = player.Character
if char.Humanoid then
	humanoid = char.Humanoid
end

humanoid.Died:Connect(function()
	event:FireServer()
end)
-- Set this in ServerScriptService

game.Players.PlayerAdded:Connect(function(player)
	local val = Instance.new("StringValue") -- Value Of The Team
	local val1 = Instance.new("StringValue") -- Players name
	val.Parent = player
	val1.Parent = player
	val1.Value = player.Name
	local val1b = val1.Value
	while wait() do
		val.Value = player.TeamColor
		if game.Workspace.val1b.Humanoid.Health = 0 and val = "[Color of the team]" then
			-- Do whatever you want to do with the GUI in here.
		wait(0.1)
	end
end

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