How do I make a multiple player progress bar

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I’m trying to make a progress bar speed up when multiple people are doing an interaction. I also want it to show up for all the people that are doing the interaction as well have it update the progress bar for all the people.

  2. What is the issue? Include screenshots / videos if possible!
    My problem is that I can’t seem to figure out a good way to do this because I’m using the TweenService and a NumberValue inside the part I want them to interact with which is the progress of the bar. I’m using the TweenService to add 1 every second to the NumberValue and I want the 1 every second to increase for every player that is interacting.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve searched many things and tried many things but I can’t really get my head around what I should do.

Here Is My Localscript I got that makes the progressbar Increase. I am new to scripting so sorry If I’ve made some mistakes and If you need any information I’ll try to give it to you.

local Humanoid = game.Players.LocalPlayer.CharacterAdded:Wait():WaitForChild("Humanoid")
local CurrentCharges = game.Players.LocalPlayer.PlayerGui:WaitForChild("ProgressBar").CurrentCharges
local Charges = game.Players.LocalPlayer.PlayerGui:WaitForChild("ProgressBar").Charges
local Background = game.Players.LocalPlayer.PlayerGui:WaitForChild("ProgressBar").Background
local UIS = game:GetService("UserInputService")
local TS = game:GetService("TweenService")


game:GetService("RunService").RenderStepped:Connect(function()
	Background.Bar.Size = UDim2.new(CurrentCharges.Value/Charges.Value,0,1,0)
	if CurrentCharges.Value >= 80 then
		CurrentCharges.Value = 0
	end
end)

CPS = 4

UIS.InputBegan:Connect(function(input) -- Start Repairing
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		Interacting = true
		InteractingRunService = game:GetService("RunService").Heartbeat:Connect(function()
			InteractingTween = TS:Create(CurrentCharges, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Value = CurrentCharges.Value + CPS})
			Interaction:Play()
			Interaction.Completed:Wait()
			Interaction:Play()
			if Interacting == false then
				Interaction:Pause()
				InteractingRunService:Disconnect()
			end
		end)
	end
end)


UIS.InputEnded:Connect(function(input) -- Cancel Repairing
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		Interacting = false
		Interaction:Pause()
	end
end)

You don’t need to write me an entire script or anything, I just want a guidance to where I should start with making this and some tips. Also if I made some scripting mistakes feel free to point them out.

1 Like