I am trying to make a cooldown on a script but it just doesnt work. I tried some stuff but it doesnt work
value = workspace.Spawner.Screen.Spawn.Frame.TextButton.Value text = workspace.Spawner.Screen.Spawn.Frame.TextLabel if value.Value == 1 then text.Text = Cooldown wait (1) text.Text = Drive Safely else script.Parent.MouseButton1Click:connect(function(GetCar) ---Start of script Mod = game.ServerStorage.Camaro clone = Mod:clone() clone.Parent = workspace clone:MakeJoints() ---End of script value.Value == 1 wait (5) value.Value == 0 end)
There's tons of errors that occurred while you were trying to make your script, here's a script that should work. Indentation is also, important.
local value = workspace.Spawner.Screen.Spawn.Frame.TextButton.Value local text = workspace.Spawner.Screen.Spawn.Frame.TextLabel local deb = false -- debounce to make the cooldown script.Parent.MouseButton1Click:Connect(function() -- event to continuously run the if check if value.Value == 1 then -- checking if the value == 1 text.Text = "Cooldown" -- quotations represent its a message wait(1) text.Text = "Drive Safely" -- quoatations else if not deb then deb = true local mod = game.ServerStorage.Camaro clone.Parent = workspace clone:MakeJoints() if value.Value == 1 then -- if statement check value.Value = 0 end wait(1) deb = false end end end)