im very tired right now so i might sound like a robot but you can see in the video after i finish teh prompt theres a slight delay before the prompt disappears, is there any way to fix that? maybe my table module sucs?
module:
LootModule.PromptTypes = {
["Ammo"] = function(Prompt,Player)
Player.Character.Ammo[Prompt:GetAttribute("AmmoType")].Value += Prompt:GetAttribute("Amount")
Prompt.Parent:Destroy()
end,
["CashRegister"] = function(Prompt,Player)
Player.leaderstats.Cash.Value += math.random(1,10)/10
local Register = Prompt.Parent.Parent
Register.Weld.C0 *= CFrame.new(1.25,0,0)
end,
["Valuable"] = function(Prompt,Player)
Player.leaderstats.Cash.Value += Prompt:GetAttribute("Value")
Prompt.Parent:Destroy()
end,
}
ProximityPromptService.PromptTriggerEnded:Connect(function(Prompt,Player)
local Type = Prompt:GetAttribute("PromptType")
if Type == nil then return end
local Character = Player.Character
if Character:FindFirstChild("Humanoid") and Character.Humanoid.Health > 0 then
LootModule.PromptTypes[Type](Prompt,Player)
Prompt:Destroy()
end
end)