Robbery System - Prompt Cooldown

So I want to make when prompt is pressed, the part dissapiers, you get “Cash” on your leaderstats. And after 50 seconds part comes back again.

You cannot ask for full scripts here, we here to help you fix your current one.

free code for u :slight_smile: (im just a nice person huh…)

local prompt = script.Parent :: ProximityPrompt -- assuming the script is parented to the prompt
local part = prompt.Parent :: BasePart -- ...and assuming the prompt is parented to the part

prompt.Triggered:Connect(function(playerWhoTriggered)
	local leaderstats = playerWhoTriggered:FindFirstChild("leaderstats")
	local cash = leaderstats:FindFirstChild("Cash")
	cash.Value += 1 -- put the number of cash you want
	
	local originalParent = part.Parent
	part.Parent = nil
	task.wait(50)
	part.Parent = originalParent
end)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.