local auraStolen = game.ReplicatedStorage.Events:FindFirstChild("AuraStolen")
local collectionZone = script.Parent
local base = collectionZone.Parent
local auras = base:FindFirstChild("AuraStorage")
local auraStands = game.ServerStorage.Assets:FindFirstChild("AuraStands")
local function collectAura(aura)
if not auras then
warn("AuraStorage not found!")
return
end
if not auraStands then
warn("AuraStands not found!")
return
end
for i, stand in auras:GetChildren() do
if stand:IsA("ValueBase") and stand.Value == "" then
local standPart = stand.Parent:FindFirstChild("Stand") or stand:FindFirstChild("Stand")
if standPart then
stand.Value = aura
local displayedAura = auraStands:FindFirstChild(aura)
if displayedAura then
local auraClone = displayedAura:Clone()
if auraClone.PrimaryPart then
auraClone:SetPrimaryPartCFrame(standPart.CFrame + Vector3.new(0, 3.5, 0))
else
auraClone:MoveTo(standPart.Position + Vector3.new(0, 3.5, 0))
end
auraClone.Parent = standPart
else
print("gurt")
end
return
else
warn("yo gurt")
end
end
end
end
collectionZone.Touched:Connect(function(part)
local auraModel = part:FindFirstAncestorWhichIsA("Model")
if not auraModel then return end
if part:FindFirstAncestor("Auras") then
collectAura(auraModel.Name)
auraModel:Destroy()
elseif part:FindFirstAncestor("StolenAuras") then
if auraStolen then
if auraModel:FindFirstChild("Base").Value == collectionZone.Parent.Name then return end
collectAura(auraModel.Name)
auraStolen:Fire(auraModel)
end
end
end)
#auras spawning too many times
1 messages · Page 1 of 1 (latest)
i tried to fix this problem like 15 times and even tried to get ai to fix the script and it still doesn't work (Only happens when auras are stolen) 🥀
What AI did you try
chat gpt
roblox assistant is ass
So is chatgpt
we tried both, niether are working
Learn Luau
Add debounce to touched event
making jojo stands is more complex
🗣️
yeah which looks like this btw:
local debounce = false
collectionZone.Touched:Connect(function(part)
if debounce then return end
-- ur code
debounce = true
task.wait(anycooldownyouwant)
debounce = false
end)
the reason you could need a debounce is that the touched event fires rapidly multiple times due to the slightest trigger so a debounce helps you control it a bit more
its not that type of stands
Tornodox isn't awake, hes who scripts the game i have no clue where to put that? is it just above and below the entire code?
oh wait no this problem has been solved
my bad, can you go to the new one I made "stealing twice don't work"
zlawg we already have a debounce