Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to delay A mouse button 1 click function?

I've already tried putting wait functions. It's pretty self explanatory.

script.Parent.MouseButton1Click:Connect(function()

	script.Parent.Text = "Please Wait."
	wait(0.2)
	script.Parent.Text = "Please Wait.."
	wait(0.2)
	script.Parent.Text = "Please Wait..."
	wait(0.2)
	
	
	if game.Players.LocalPlayer.Jeep.Value == true then
		script.Parent.Text = "Spawn"
		game.ReplicatedStorage.SpawnCar:FireServer(script.Parent.Parent.Name)
		script.Parent.Parent.Parent.Visible = false
		
	else
			
		-- Let them purchase it
	
		local PriceOfItem = game.ReplicatedStorage:WaitForChild("CheckPrice"):InvokeServer(script.Parent.Parent.Name)
		
		if game.Players.LocalPlayer.leaderstats.Cash.Value >= PriceOfItem and script.Parent.Parent.Purchased.Value == false then
			-- The player has enough cash
			game.Players.LocalPlayer.leaderstats.Cash.Value = game.Players.LocalPlayer.leaderstats.Cash.Value - PriceOfItem
			script.Parent.Parent.Purchased.Value = true
			game.Players.LocalPlayer.Jeep.Value = true
			script.Parent.Text = "Spawn"
			
			script.Parent.Parent.Parent.Visible = false
		end
	end
	end)

6 comments

0
  1. explain further, i dont understand. 2. post the script
0

added

0

Add a bool value and use if statements

0

This is alvinbloxx’s code again.

0

Alvinblox lmao

0

^ This question breaks the "Attempts should be of own work" rule.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.