AirDrop message

Hello. I want that when an airdrop spawns in the chat, a message is written in the chat that the airdrop has been spawned. If it’s not difficult for you, please update my script.

My script:
local rnd = Random.new()

local minTimePerDrop = 120
local maxTimePerDrop = 180

local minReward = 5
local maxReward = 2000

local minFallVelocity = -3
local maxFallVelocity = -8

while true do

task.wait(rnd:NextNumber(minTimePerDrop, maxTimePerDrop))


local airdrop = script:WaitForChild("Airdrop"):Clone()

local randomPos = Vector3.new(rnd:NextNumber(-300, 300), 200, rnd:NextNumber(-300,  300))
local newCF = CFrame.new(randomPos) * CFrame.Angles(0, rnd:NextNumber(0, 2*math.pi), 0)
airdrop:PivotTo(newCF)

local atch0 = Instance.new("Attachment")
atch0.Name = "Attachment0"
atch0.Parent = airdrop.Crate

local lv = Instance.new("LinearVelocity")
lv.MaxForce = math.huge
lv.RelativeTo = Enum.ActuatorRelativeTo.World
lv.VelocityConstraintMode = Enum.VelocityConstraintMode.Vector
lv.VectorVelocity = Vector3.new(rnd:NextNumber(-5, 5), rnd:NextNumber(maxFallVelocity, minFallVelocity), rnd:NextNumber(-5, 5))
lv.Attachment0 = atch0
lv.Parent = airdrop.Crate

local av = Instance.new("AngularVelocity")
av.MaxTorque = math.huge
av.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
av.AngularVelocity = Vector3.new(0, rnd:NextNumber(-1, 1), 0)
av.Attachment0 = atch0
av.Parent = airdrop.Crate


airdrop.Crate.Touched:Connect(function(hit)
	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)

	if plr and hit.Parent.Humanoid.Health > 0 then

		airdrop:Destroy()

		if not plr:FindFirstChild("DATA FAILED TO LOAD") then
			plr.leaderstats.Cash.Value += rnd:NextInteger(minReward, maxReward)
		end
	end
end)


airdrop.Parent = workspace


task.spawn(function()
	repeat 
		task.wait(1)
	until not airdrop or airdrop.Parent ~= workspace or airdrop.Crate.AssemblyLinearVelocity.Y > minFallVelocity

	if airdrop and airdrop.Parent == workspace then
		lv:Destroy()
		av:Destroy()
		atch0:Destroy()

		airdrop.Crate.Parachute:Destroy()
		airdrop.Parachute.CanCollide = false

		game:GetService("Debris"):AddItem(airdrop.Parachute, 5)
	end
end)

end

game.StarterGui:SetCore("ChatMakeSystemMessage",{Text = "Airdrop has spawned!",Color = Color3.fromRGB(255,0,0 ), Font = Enum.Font.Arial } )

The point of Scripting Support is to help developers with bugs/issues with their scripts, not ask for someone else to script something for them.

To send a “system” message into the chat you will need to use SetCore("ChatMakeSystemMessage")
Here is some example code

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCore("ChatMakeSystemMessage", {
    Text = "Hello!";
    Font = Enum.Font.Cartoon;
    Color = Color3.new(0,0,0);
    FontSize = Enum.FontSize.Size96;    
})
2 Likes

Hello again, sorry for taking so long, nothing is being written to the chat, my script.
(helped with AI)

local Airdrop = Workspace:WaitForChild(“Airdrop”)

Airdrop.ChildAdded:Connect(function(child)
if child.Name == “Spawned” then
local message = “An airdrop has spawned!”
game:GetService(“StarterGui”):SetCore(“ChatMakeSystemMessage”, {
Text = message;
Font = Enum.Font.Cartoon;
Color = BrickColor.new(“Crimson”);
FontSize = Enum.FontSize.Size24;
})
end
end)

Not sure if this works with Roblox’s new chat system, to change it to the old one, set ChatVersion in TextChatService to LegacyChatService
image

Also Color needs to be a Color3, not a BrickColor, make sure you change that in the script

I change the color but its dont working, idk why dosnt work, output say nothing, im create PlayerScript cuz StarterGui:SetCore:

local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local AirdropEvent = ReplicatedStorage:WaitForChild(“AirdropEvent”)

AirdropEvent.OnClientEvent:Connect(function()
local message = “An airdrop has spawned!”
game:GetService(“StarterGui”):SetCore(“ChatMakeSystemMessage”, {
Text = message;
Font = Enum.Font.Cartoon;
Color = Color3.fromRGB(255, 0, 0);
FontSize = Enum.FontSize.Size24;
})
end)

script on ServerScriptService:

local Workspace = game:GetService(“Workspace”)

local Airdrop = Workspace:WaitForChild(“Airdrop”)

local Players = game:GetService(“Players”)

local ReplicatedStorage = game:GetService(“ReplicatedStorage”)

local event = ReplicatedStorage:WaitForChild(“AirdropEvent”)

Airdrop.ChildAdded:Connect(function(child)

if child.Name == “Spawned” then

local message = “An airdrop has spawned!”

event:FireAllClients(message)

end

end)

Go to TextChatService in explorer and send a screenshot of properties.

image