game.Players.PlayerAdded:connect(function(l)repeat wait()until l.Character or l.Parent~=game.Players local s=Instance.new("\073\110\116\067\111\110\115\116\114\097\105\110\101\100\086\097\108\117\101",l)s.MaxValue=max s.Value=def s.Name="\082\101\115\111\117\114\099\101\115"while l.Parent==game.Players and wait(sp)do if s.Value<max then s.Value=s.Value+amt end end end)

game.Players.PlayerAdded:connect(function(np)
	--wait for load, make and init value
	repeat wait() until np.Character or np.Parent ~= game.Players
	local resources = Instance.new("IntConstrainedValue",np)
	resources.MaxValue = max
	resources.Value = def
	resources.Name = "Resources"
	
	--regen over time
	while np.Parent == game.Players and wait(sp) do
		if resources.Value < max then
			--do not exceed max
			resources.Value = resources.Value + amt
		end
	end
end)
