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)
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "Hello!";
Font = Enum.Font.Cartoon;
Color = Color3.new(0,0,0);
FontSize = Enum.FontSize.Size96;
})
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)