Basically it needs to detect if the firework hits the ring, but both are anchored so I can’t use Touched. I did while true do with a small wait to constantly check but I feel like this is bad practice and could lead to lag. Here’s my current code
local ring = script.Parent
local hitbox = ring.Hitbox
local touch
local amount = 10
local debounce = true
print("c")
while true do
touch = game.Workspace:GetPartsInPart(hitbox)
for i, v in pairs(touch) do
if v.Parent:FindFirstChild("Sound") then
if debounce == true then
debounce = false
local playerName = v.Parent:GetAttribute("Player")
print(playerName)
local player = game.Players:FindFirstChild(playerName)
game.ReplicatedStorage.Remotes.CashEffect:FireClient(player, player, amount*5)
ring:Destroy()
break
end
end
end
wait(0.1)
end