#I need a script FAST where it will say in the chat when a player has died

1 messages · Page 1 of 1 (latest)

west mirage
#

It’ll be like “player has died!” When they die in chat I literally need this script IMMEDIATELY for an event I’m working on

fossil tusk
#

idk

loud edge
#

sds

wraith mirage
#

I IMMEDIATELY don’t know how to help you.

solar phoenix
#

here i gotchu

#

firsy

solar phoenix
#

then put this code as a local script under startergui

#

local players = game:GetService("Players")
local plr = players.LocalPlayer

local rp = game:GetService("ReplicatedStorage")
local sendChat = rp:WaitForChild("SendChat")

local tcs = game:GetService("TextChatService")

sendChat.OnClientEvent:Connect(function(msg, tag)
tcs.TextChannels.RBXGeneral:DisplaySystemMessage("[".. tag .."]".. msg)
end)

#

Now, put this script under serverscriptservice

#

local players = game:GetService("Players")
local rp = game:GetService("ReplicatedStorage")
local sendChat = rp:WaitForChild("SendChat")

players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local hum = char:WaitForChild("Humanoid")
hum.Died:Connect(function()
sendChat:FireAllClients(" ".. plr.Name .. " has died!", "Server")
end)
end)
end)

#

there u go @west mirage , finished!

west mirage
#

ALSO

#

DO YKU KNOW HOW TO KAKE A SCRIPT WHERE

#

WHEN A SCREEN GUI BUTTON IS PRESSED, IT COPIES A TOOL CALLED PUSH FROM REPLICATED STORAGE AND SENDS IT TO EVERY PLAYER IN THR GAME?

solar phoenix
#

of course

#

gimme one sec, lemme script that

west mirage
#

I GOT LIKE 20 MINS

#

TYSM UR A LIFE SAVER

solar phoenix
#

ok so

solar phoenix
#

local button = script.Parent
local rp = game:GetService("ReplicatedStorage")

local giveTool = rp:WaitForChild("GiveTool")

button.Activated:Connect(function(input, clickCount)
giveTool:FireServer()
end)

#

--oh and make a remote event named GiveTool

#

and put ur tool in replicated storage

#

and put this as a script under server script service

#

local players = game:GetService("Players")
local rp = game:GetService("ReplicatedStorage")

local tool = rp:WaitForChild("Tool") -- change this to the name of your tool

local giveTool = rp:WaitForChild("GiveTool")

giveTool.OnServerEvent:Connect(function(plr)
local clone = tool:Clone()
for _, player in players:GetPlayers() do
local backpack = player:FindFirstChild("Backpack")
if backpack then
local tool = backpack:FindFirstChild("Tool")
if not tool then
clone.Parent = backpack
end
end
end
end)

#

there u go @west mirage !

west mirage
solar phoenix
#

yw!

#

dont forget to modify the rp:WaitForChild("Tool") to the name of ur tool

#

for exampl

#

i change rp:WaitForChild("Tool") to rp:WaitForChild("Sword") if the name of tool i had was called 'Sword'

solar phoenix
#

is it working @west mirage ?

oak lagoonBOT
#

studio** You are now Level 6! **studio

wraith escarp
#

On a server script

solar phoenix
#

plus u can use plr.Character.Humanoid.HealthChanged instead

wraith escarp
solar phoenix
#

fir

#

a server message

#

how else will we access the players gui?

wraith escarp