Bindable Event giving our random timer numbers

I have this Timer and when you eat vitamins you get 45 seconds added to your timer. I used a bindable event and it fires perfectly but it adds random numbers to the timer. Sometimes it’s 2 minutes and sometimes its 4 seconds. Any advice? Thank you for your time.

		Addtime.Event:Connect(function()
			currentTime += 2
		end)

You should track how many times the event is fired, just incase.

1 Like

How would you do that? 30charlimit

This sounds less like a issue with your BindableEvent and more like an issue with how it was executed. from what im seeing you are probably looping this BindableEvent in a “i loop” because you arent giving the event function any arguments which can cause several issues.

--//Tool Script\\--
Tool.Activated:connect(function()
     BD:Fire(45)
     Tool:Destroy()
end)

--//Binable Event Script\\--
Addtime.Event:Connect(function(Amount)
	currentTime += Amount
end)

Alternatively you could’ve just accessed this timer through the tool script since it is ran through the server but this is probably what you’re looking for.

you print in the output when the event fires

I fixed it in another forum post but thanks guys! It was because I didnt deconnect the event.

1 Like